This repository has been archived by the owner on Jun 1, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 244
/
webpack.build.config.js
90 lines (84 loc) · 1.93 KB
/
webpack.build.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
var webpack = require("webpack");
var path = require("path");
// var version = require("./package.json").version;
// var banner = "/**\n" + " * vue-form-generator v" + version + "\n" + " * https://github.com/icebob/vue-form-generator\n" + " * Released under the MIT License.\n" + " */\n";
var ExtractTextPlugin = require("extract-text-webpack-plugin");
var StatsPlugin = require("stats-webpack-plugin");
var OptimizeCssAssetsPlugin = require('optimize-css-assets-webpack-plugin');
var cssLoader = {
loader: "css-loader",
options: {
minimize: true
}
};
var sassLoader = {
loader: "sass-loader",
options: {
minimize: true
}
};
var loaders = [
{
test: /\.js?$/,
exclude: /node_modules/,
loader: "babel-loader"
},
{
test: /\.css$/,
loader: 'css-loader'
},
{
test: /\.scss$/,
loaders: ['css-loader', 'sass-loader']
},
{
test: /\.vue?$/,
loader: "vue-loader",
/* options:{
loaders:{
scss: 'css-loader!sass-loader'
}
}*/
options:{
loaders: {
css: ExtractTextPlugin.extract({use:[cssLoader]}),
postcss: ExtractTextPlugin.extract({use:[cssLoader]}),
scss: ExtractTextPlugin.extract({use:[cssLoader,sassLoader]}),
}
}
}
];
module.exports = [
{
entry: "./src/index.js",
output: {
path: path.resolve(__dirname, './dist'),
filename: "vue-form-wizard.js",
library: "VueFormWizard",
libraryTarget: "umd"
},
plugins: [
new webpack.DefinePlugin({
'process.env' : {
NODE_ENV : '"production"'
}
}),
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false
}
}),
/* new webpack.BannerPlugin(banner, {
raw: true
}),*/
new ExtractTextPlugin({filename:"vue-form-wizard.min.css", allChunks: true, fallback:"style-loader" }),
new StatsPlugin( {filename:"./stats.json",
chunkModules: true
//exclude: [/node_modules[\\\/]react/]
}),
],
module: {
rules:loaders
},
}
];