forked from nukeop/react-ui-cards
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.publish.js
39 lines (37 loc) · 950 Bytes
/
webpack.config.publish.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
const webpack = require('webpack');
const path = require('path');
const SRC_DIR = path.resolve(__dirname, 'src');
const DIST_DIR = path.resolve(__dirname, 'dist');
module.exports = {
entry: path.resolve(SRC_DIR, 'index.js'),
output: {
path: DIST_DIR,
filename: 'bundle.js',
library: 'cards',
libraryTarget: "commonjs2",
libraryExport: "default"
},
mode: 'production',
devtool: 'source-map',
optimization: {
namedModules: true
},
module: {
rules: [
{
test: /\.jsx?/,
loader: 'babel-loader',
exclude: /node_modules/
}, {
test: /\.css/,
loader: 'style-loader!css-loader?modules=true&localIdentName=[name]__[local]___[hash:base64:5]'
}, {
test: /\.scss$/,
loader: 'style-loader!css-loader?importLoaders=1&modules&localIdentName=[local]!sass-loader'
}, {
test: /\.svg$/,
loader: 'raw-loader'
}
]
}
};