]> Softwares of Agnibho - pdosage.git/blob - webpack.config.js
Typo correction
[pdosage.git] / webpack.config.js
1 var path = require('path')
2 var webpack = require('webpack')
3
4 module.exports = {
5 entry: './src/main.js',
6 output: {
7 path: path.resolve(__dirname, 'dist'),
8 publicPath: 'dist/',
9 filename: 'bundle.js'
10 },
11 module: {
12 rules: [
13 {
14 test: /\.vue$/,
15 loader: 'vue-loader',
16 options: {
17 // vue-loader options go here
18 }
19 },
20 {
21 test: /\.js$/,
22 loader: 'babel-loader?presets=es2015&retainLines=true',
23 exclude: /node_modules/
24 },
25 {
26 test: /\.css$/,
27 loader: 'style-loader!css-loader'
28 },
29 {
30 test: /\.(png|jpg|gif|svg|eot|ttf|woff|woff2)$/,
31 loader: 'file-loader',
32 options: {
33 name: '[name].[ext]?[hash]'
34 }
35 },
36 {
37 test: /\.json$/,
38 loader: 'json-loader'
39 }
40 ]
41 },
42 resolve: {
43 alias: {
44 'vue$': 'vue/dist/vue',
45 'jquery': 'jquery/src/jquery'
46 }
47 },
48 plugins: [
49 new webpack.ProvidePlugin({
50 $: 'jquery',
51 jquery: 'jquery'
52 })
53 ],
54 devServer: {
55 historyApiFallback: true,
56 noInfo: true
57 },
58 devtool: '#eval-source-map'
59 }
60
61 if (process.env.NODE_ENV === 'production') {
62 module.exports.devtool = '#source-map'
63 // http://vue-loader.vuejs.org/en/workflow/production.html
64 module.exports.plugins = (module.exports.plugins || []).concat([
65 new webpack.DefinePlugin({
66 'process.env': {
67 NODE_ENV: '"production"'
68 }
69 }),
70 new webpack.optimize.UglifyJsPlugin({
71 sourceMap: true,
72 compress: {
73 warnings: false
74 }
75 }),
76 new webpack.LoaderOptionsPlugin({
77 minimize: true
78 })
79 ])
80 }