Repository navigation
Expand file tree
/
Copy pathwebpack.config.js
More file actions
63 lines (62 loc) · 1.53 KB
/
Copy pathwebpack.config.js
File metadata and controls
63 lines (62 loc) · 1.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
var path = require('path');
const webpack = require('webpack');
var _ = require('lodash');
var os = require('os');
const UglifyEsPlugin = require('uglify-es-webpack-plugin');
const WebpackShellPlugin = require('webpack-shell-plugin');
module.exports = {
entry: './App/App.jsx',
output: {
path: path.resolve(__dirname, 'public'),
filename: 'bundle.js'
},
resolve: {
alias: {
},
extensions: [
'.js', '.jsx', '.css', ',scss'
]
},
module: {
rules: [
{
test: /\.jsx?$/,
exclude: /(node_modules|bower_components)/,
loader: 'babel-loader',
query: {
presets:[ 'env', 'react', 'stage-3' ]
}
},
{
test: /\.css$/,
loaders: [
'style-loader',
'css-loader?sourceMap&modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]!postcss-loader?sourceMap&sourceComments'
],
include: path.join(__dirname, 'node_modules'),
exclude: /flexboxgrid/
},
{
test: /\.css$/,
loader: 'style-loader!css-loader?modules',
include: /flexboxgrid/
},
{
test: /\.scss$/,
use: [{loader: "style-loader"}, {loader: "css-loader"}, {loader: "sass-loader"}]
}
]
},
plugins: [
new WebpackShellPlugin({
onBuildStart:['babel src -d lib --copy-files']
})
// new webpack.DefinePlugin({
// 'process.env': {
// NODE_ENV: JSON.stringify('production')
// }
// })
// ,
// new UglifyEsPlugin()
]
};