-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathwebpack.conf.js
40 lines (37 loc) · 970 Bytes
/
webpack.conf.js
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
const path = require('path');
const WebpackBemPlugin = require('../../index');
function resolver(relativePath) {
return path.resolve(`examples/few-components/${relativePath}`);
}
module.exports = {
entry: './entry.js',
externals: {
'react': 'React',
'react-dom': 'ReactDOM'
// TODO: put bem-react-core here after https://github.com/bem/bem-react-core/issues/218
},
output: {
path: resolver('public'),
filename: '[setName].bundle.js'
},
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
use: 'babel-loader'
},
{
test: /\.css$/,
use: ['style-loader', 'css-loader']
}
]
},
plugins: [
new WebpackBemPlugin({
techs: ['js', 'css'],
techMap: { js: 'react.js' }
})
],
context: resolver('src')
};