generated from ironmansoftware/universal-dashboard-component
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
55 lines (51 loc) · 1.38 KB
/
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
var webpack = require('webpack');
var path = require('path');
var BUILD_DIR = path.resolve(__dirname, 'public');
var SRC_DIR = path.resolve(__dirname);
var APP_DIR = path.resolve(__dirname, 'src/app');
module.exports = (env) => {
const isDev = env == 'development' || env == 'isolated';
return {
entry: {
'index' : __dirname + '/components/index.js'
},
output: {
path: BUILD_DIR,
filename: isDev ? 'component.[name].bundle.js' : '[name].[hash].bundle.js',
sourceMapFilename: '[name].[hash].bundle.map',
publicPath: "",
library: 'udcomponent',
libraryTarget: 'var'
},
module : {
rules : [
{ test: /\.css$/, loader: "style-loader!css-loader" },
{ test: /\.(js|jsx)$/, exclude: [/node_modules/, /public/], loader: 'babel-loader'},
{ test: /\.(eot|ttf|woff2?|otf|svg|png)$/, loader:'file-loader', options: {
name: '[name].[ext]'
} }
]
},
externals: {
UniversalDashboard: 'UniversalDashboard',
$: "$",
'react': 'react',
'react-dom': 'reactdom'
},
resolve: {
extensions: ['.json', '.js', '.jsx']
},
devtool: 'source-map',
devServer: {
disableHostCheck: true,
historyApiFallback: true,
port: 10000,
// hot: true,
compress:true,
publicPath: '/',
stats: "minimal"
},
plugins: [
]
};
}