forked from bjgrosse/simple-embeddable-react-widget
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
34 lines (32 loc) · 930 Bytes
/
webpack.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
const path = require('path');
const webpack = require('webpack');
var copyWebpackPlugin = require('copy-webpack-plugin');
const bundleOutputDir = './dist';
module.exports = (env) => {
const isProductionBuild = env && env.production;
return [{
entry: './src/main.js',
mode: 'production',
output: {
filename: 'widget.js',
path: path.resolve(bundleOutputDir),
},
module: {
rules: [
{
test: /\.(js|jsx)$/,
exclude: /node_modules/,
use: ['babel-loader']
},
{
test: /\.css$/i,
use: ['style-loader', 'css-loader']
}
],
},
devServer: {
contentBase: bundleOutputDir
},
plugins: [new copyWebpackPlugin([{ from: 'demo/' }])]
}];
};