Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import path from 'path';
- import webpack, { DefinePlugin, BannerPlugin, HotModuleReplacementPlugin, NoErrorsPlugin } from 'webpack';
- import merge from 'lodash/object/merge';
- const DEBUG = !process.argv.includes('--release');
- const GLOBALS = {
- 'process.env.NODE_ENV': DEBUG ? '"development"' : '"production"',
- __DEV__: DEBUG
- };
- const config = {
- output: {
- publicPath: '/',
- sourcePrefix: ' '
- },
- cache: true,
- debug: true,
- plugins: [
- new webpack.optimize.OccurenceOrderPlugin()
- ]
- };
- const appConfig = merge({}, config, {
- entry: [
- 'webpack-hot-middleware/client',
- './src/client/app.js'
- ],
- output: {
- path: path.join(__dirname, '../build/public'),
- filename: 'app.js'
- },
- devtool: 'cheap-module-eval-source-map',
- plugins: [
- ...config.plugins,
- new webpack.DefinePlugin(GLOBALS),
- new HotModuleReplacementPlugin(),
- new NoErrorsPlugin()
- ],
- module: {
- loaders: [{
- test: /\.js?$/,
- include: [
- path.resolve(__dirname, '../src')
- ],
- loaders: ['react-hot', 'babel-loader']
- }]
- }
- });
- export default appConfig;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement