esnextbin
Version:
Prototype JavaScript programs in the browser with ESNext (a.k.a ES2015) syntax and features, using modules from NPM.
46 lines (39 loc) • 862 B
JavaScript
const webpack = require('webpack');
const path = require('path');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
module.exports = {
devtool: 'eval',
entry: {
app: './src/app',
embed: './src/embed'
},
output: {
path: path.join(__dirname, 'build'),
filename: '[name].js',
publicPath: '/'
},
plugins: [
new webpack.DefinePlugin({
'process.env': {
'NODE_ENV': JSON.stringify('development')
}
}),
new ExtractTextPlugin('[name].css')
],
resolve: {
extensions: ['.js', '.jsx', 'json']
},
module: {
rules: [{
test: /\.jsx?$/,
exclude: /node_modules/,
loader: 'babel-loader'
}, {
test: /\.css$/,
use: ExtractTextPlugin.extract({
fallback: 'style-loader',
use: ['css-loader', 'postcss-loader']
})
}]
}
};