forked from rahul2104/react-country-flag-currency-picker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnwb.config.js
44 lines (42 loc) · 996 Bytes
/
nwb.config.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
41
42
43
44
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
module.exports = {
type: 'react-component',
npm: {
esModules: true,
umd: {
global: 'ReactFlagsSelect',
externals: {
react: 'React'
}
}
},
webpack: {
styles: false,
extra: {
module: {
rules: [
{
test: /\.(sa|sc|c)ss$/,
use: [
{
loader: MiniCssExtractPlugin.loader,
},
{loader: 'css-loader'},
{loader: 'sass-loader'}
]
}
]
},
plugins: [
new MiniCssExtractPlugin()
]
},
config: (config) => {
// include scss file in entry for UMD so it gets processed
if(config.output.libraryTarget === 'umd' && config.entry.indexOf('./scss/react-flags-currency-select.scss') < 0) {
config.entry.push('./scss/react-flags-currency-select.scss');
}
return config;
}
}
};