This repository was archived by the owner on Mar 11, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathwebpack.config.js
More file actions
49 lines (44 loc) · 1.29 KB
/
webpack.config.js
File metadata and controls
49 lines (44 loc) · 1.29 KB
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
var path = require('path');
var webpack = require('webpack');
module.exports.getWebpackConfig = (minify) => {
let config = {
watch: false,
entry: "./framework7-react/index.ts",
resolve: {
extensions: [".ts", ".tsx", ".js"]
},
output: {
filename: 'framework7-react.js',
library: 'framework7-react',
libraryTarget: 'umd'
},
module: {
rules: [
{ test: /\.tsx?$/, loader: "awesome-typescript-loader?declaration=false" },
{ test: /\.js$/, exclude: /(node_modules)/, loader: "babel-loader" }
]
},
externals: {
"react": "React"
},
devtool: 'source-map',
plugins: []
};
if (minify) {
config.output.filename = 'framework7-react.min.js';
config.plugins.push(
new webpack.LoaderOptionsPlugin({ minimize: true, debug: false })
);
config.plugins.push(
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false,
},
output: {
comments: false,
}
})
);
}
return config;
};