UNPKG

@upendradevsingh/webcore

Version:
59 lines (55 loc) 1.57 kB
var webpack = require('webpack'); var path = require('path'); var BUILD_DIR = path.resolve(__dirname, 'build'); var APP_DIR = path.resolve(__dirname, 'src'); var config = { devtool: 'source-map', entry: APP_DIR + '/main.js', output: { path: BUILD_DIR, filename: 'bundle.js' }, plugins: [ new webpack.optimize.OccurenceOrderPlugin(), // new webpack.DefinePlugin({ // 'process.env': { // 'NODE_ENV': JSON.stringify('production') // } // }), // new webpack.optimize.UglifyJsPlugin({ // compressor: { // warnings: false, // drop_console: true, // dead_code: true, // unused: true, // passes: 3 // } // }), ], module: { loaders: [ { test: /\.js$/, exclude: /node_modules/, loaders: ['babel-loader', /*'eslint-loader' */ ] }, { exclude: /node_modules/, loader: 'babel', query: { presets: ['react', 'es2015', 'stage-1'], plugins: ["react-html-attrs", "transform-class-properties", "transform-decorators-legacy"] } } ] }, resolve: { extensions: ['', '.js', '.jsx', '.css'] }, devServer: { historyApiFallback: true, contentBase: './', inline: true } }; module.exports = config;