56 lines
1.2 KiB
JavaScript
56 lines
1.2 KiB
JavaScript
const webpack = require('webpack');
|
|
const path = require('path');
|
|
|
|
module.exports = (env, argv) => ({
|
|
entry: {
|
|
main: [ "babel-polyfill", './main.js' ]
|
|
},
|
|
context: __dirname,
|
|
output: {
|
|
path: __dirname+'/dist',
|
|
filename: '[name].js'
|
|
},
|
|
devtool: 'cheap-module-source-map',
|
|
module: {
|
|
rules: [
|
|
{
|
|
test: /.jsx?$/,
|
|
loader: 'babel-loader',
|
|
exclude: /node_modules(?!\/react-toolbox\/components|\/dynamic-virtual-scroll)/
|
|
},
|
|
{
|
|
test: /\.css$/,
|
|
use: [
|
|
{
|
|
loader: "style-loader",
|
|
options: {
|
|
singleton: true
|
|
}
|
|
},
|
|
{
|
|
loader: "css-loader",
|
|
options: {
|
|
modules: true, // default is false
|
|
sourceMap: true,
|
|
importLoaders: 1,
|
|
localIdentName: "[name]--[local]--[hash:base64:8]"
|
|
}
|
|
},
|
|
"postcss-loader"
|
|
]
|
|
}
|
|
]
|
|
},
|
|
plugins: [
|
|
new webpack.DefinePlugin({
|
|
"process.env": {
|
|
NODE_ENV: JSON.stringify(argv.mode || "production")
|
|
}
|
|
})
|
|
],
|
|
performance: {
|
|
maxEntrypointSize: 5000000,
|
|
maxAssetSize: 5000000
|
|
}
|
|
});
|