| author | ymh <ymh.work@gmail.com> |
| Thu, 02 Aug 2018 10:51:00 +0200 | |
| changeset 588 | fbca079ab5f5 |
| parent 541 | 4aa4664b0343 |
| permissions | -rw-r--r-- |
|
539
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
1 |
const path = require('path') |
|
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
2 |
const webpack = require('webpack') |
|
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
3 |
const UglifyJsPlugin = require('uglifyjs-webpack-plugin') |
|
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
4 |
const projectRoot = path.resolve(__dirname) |
|
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
5 |
const VueLoaderPlugin = require('vue-loader/lib/plugin') |
|
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
6 |
const LodashModuleReplacementPlugin = require('lodash-webpack-plugin') |
|
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
7 |
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin |
|
541
4aa4664b0343
replace extract-text-webpack-plugin (deprecated) by mini-css-extract-plugin. Try to make webpack-dev-server work again on the project
ymh <ymh.work@gmail.com>
parents:
539
diff
changeset
|
8 |
const MiniCssExtractPlugin = require('mini-css-extract-plugin') |
|
4aa4664b0343
replace extract-text-webpack-plugin (deprecated) by mini-css-extract-plugin. Try to make webpack-dev-server work again on the project
ymh <ymh.work@gmail.com>
parents:
539
diff
changeset
|
9 |
const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin') |
|
146
f912b591e1c1
new src_js folder
Harris Baptiste <harris.baptiste@iri.centrepompidou.fr>
parents:
diff
changeset
|
10 |
|
|
f912b591e1c1
new src_js folder
Harris Baptiste <harris.baptiste@iri.centrepompidou.fr>
parents:
diff
changeset
|
11 |
module.exports = { |
|
309
c5b524696fb3
Improve JS/CSS compilation.
Alexandre Segura <mex.zktk@gmail.com>
parents:
299
diff
changeset
|
12 |
entry: { |
|
316
ffa87fe82904
Missing webpack.config.js from previous commit.
Alexandre Segura <mex.zktk@gmail.com>
parents:
309
diff
changeset
|
13 |
vendor: [ |
|
ffa87fe82904
Missing webpack.config.js from previous commit.
Alexandre Segura <mex.zktk@gmail.com>
parents:
309
diff
changeset
|
14 |
'jquery', |
|
539
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
15 |
'bootstrap' |
|
316
ffa87fe82904
Missing webpack.config.js from previous commit.
Alexandre Segura <mex.zktk@gmail.com>
parents:
309
diff
changeset
|
16 |
], |
|
309
c5b524696fb3
Improve JS/CSS compilation.
Alexandre Segura <mex.zktk@gmail.com>
parents:
299
diff
changeset
|
17 |
iconolab: [ |
|
359
e435cad79dfe
Move JS conf files back to iconolab-bundle folder.
Alexandre Segura <mex.zktk@gmail.com>
parents:
316
diff
changeset
|
18 |
'./src/main.js', |
|
539
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
19 |
'./src/main.scss' |
|
309
c5b524696fb3
Improve JS/CSS compilation.
Alexandre Segura <mex.zktk@gmail.com>
parents:
299
diff
changeset
|
20 |
] |
|
c5b524696fb3
Improve JS/CSS compilation.
Alexandre Segura <mex.zktk@gmail.com>
parents:
299
diff
changeset
|
21 |
}, |
|
146
f912b591e1c1
new src_js folder
Harris Baptiste <harris.baptiste@iri.centrepompidou.fr>
parents:
diff
changeset
|
22 |
output: { |
|
539
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
23 |
path: path.join(__dirname, '/../../src/iconolab/static'), |
|
309
c5b524696fb3
Improve JS/CSS compilation.
Alexandre Segura <mex.zktk@gmail.com>
parents:
299
diff
changeset
|
24 |
publicPath: '/static/', |
|
c5b524696fb3
Improve JS/CSS compilation.
Alexandre Segura <mex.zktk@gmail.com>
parents:
299
diff
changeset
|
25 |
filename: 'iconolab/js/[name].js' |
|
146
f912b591e1c1
new src_js folder
Harris Baptiste <harris.baptiste@iri.centrepompidou.fr>
parents:
diff
changeset
|
26 |
}, |
|
f912b591e1c1
new src_js folder
Harris Baptiste <harris.baptiste@iri.centrepompidou.fr>
parents:
diff
changeset
|
27 |
module: { |
|
539
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
28 |
rules: [{ |
|
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
29 |
test: /\.vue$/, |
|
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
30 |
loader: 'vue-loader' |
|
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
31 |
}, |
|
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
32 |
{ |
|
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
33 |
test: /\.css$/, |
|
541
4aa4664b0343
replace extract-text-webpack-plugin (deprecated) by mini-css-extract-plugin. Try to make webpack-dev-server work again on the project
ymh <ymh.work@gmail.com>
parents:
539
diff
changeset
|
34 |
use: [{ |
|
4aa4664b0343
replace extract-text-webpack-plugin (deprecated) by mini-css-extract-plugin. Try to make webpack-dev-server work again on the project
ymh <ymh.work@gmail.com>
parents:
539
diff
changeset
|
35 |
loader: MiniCssExtractPlugin.loader |
|
4aa4664b0343
replace extract-text-webpack-plugin (deprecated) by mini-css-extract-plugin. Try to make webpack-dev-server work again on the project
ymh <ymh.work@gmail.com>
parents:
539
diff
changeset
|
36 |
}, { |
|
4aa4664b0343
replace extract-text-webpack-plugin (deprecated) by mini-css-extract-plugin. Try to make webpack-dev-server work again on the project
ymh <ymh.work@gmail.com>
parents:
539
diff
changeset
|
37 |
loader: 'css-loader', |
|
4aa4664b0343
replace extract-text-webpack-plugin (deprecated) by mini-css-extract-plugin. Try to make webpack-dev-server work again on the project
ymh <ymh.work@gmail.com>
parents:
539
diff
changeset
|
38 |
options: { |
|
4aa4664b0343
replace extract-text-webpack-plugin (deprecated) by mini-css-extract-plugin. Try to make webpack-dev-server work again on the project
ymh <ymh.work@gmail.com>
parents:
539
diff
changeset
|
39 |
module: true, |
|
4aa4664b0343
replace extract-text-webpack-plugin (deprecated) by mini-css-extract-plugin. Try to make webpack-dev-server work again on the project
ymh <ymh.work@gmail.com>
parents:
539
diff
changeset
|
40 |
localIdentName: '[local]' |
|
4aa4664b0343
replace extract-text-webpack-plugin (deprecated) by mini-css-extract-plugin. Try to make webpack-dev-server work again on the project
ymh <ymh.work@gmail.com>
parents:
539
diff
changeset
|
41 |
} |
|
4aa4664b0343
replace extract-text-webpack-plugin (deprecated) by mini-css-extract-plugin. Try to make webpack-dev-server work again on the project
ymh <ymh.work@gmail.com>
parents:
539
diff
changeset
|
42 |
}], |
|
539
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
43 |
include: [ |
|
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
44 |
path.join(__dirname, '/src'), |
|
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
45 |
/node_modules/ |
|
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
46 |
] |
|
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
47 |
}, |
|
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
48 |
{ |
|
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
49 |
test: /\.scss$/, |
|
541
4aa4664b0343
replace extract-text-webpack-plugin (deprecated) by mini-css-extract-plugin. Try to make webpack-dev-server work again on the project
ymh <ymh.work@gmail.com>
parents:
539
diff
changeset
|
50 |
use: [{ |
|
4aa4664b0343
replace extract-text-webpack-plugin (deprecated) by mini-css-extract-plugin. Try to make webpack-dev-server work again on the project
ymh <ymh.work@gmail.com>
parents:
539
diff
changeset
|
51 |
loader: MiniCssExtractPlugin.loader |
|
4aa4664b0343
replace extract-text-webpack-plugin (deprecated) by mini-css-extract-plugin. Try to make webpack-dev-server work again on the project
ymh <ymh.work@gmail.com>
parents:
539
diff
changeset
|
52 |
}, { |
|
4aa4664b0343
replace extract-text-webpack-plugin (deprecated) by mini-css-extract-plugin. Try to make webpack-dev-server work again on the project
ymh <ymh.work@gmail.com>
parents:
539
diff
changeset
|
53 |
loader: 'css-loader', |
|
4aa4664b0343
replace extract-text-webpack-plugin (deprecated) by mini-css-extract-plugin. Try to make webpack-dev-server work again on the project
ymh <ymh.work@gmail.com>
parents:
539
diff
changeset
|
54 |
options: { |
|
4aa4664b0343
replace extract-text-webpack-plugin (deprecated) by mini-css-extract-plugin. Try to make webpack-dev-server work again on the project
ymh <ymh.work@gmail.com>
parents:
539
diff
changeset
|
55 |
module: true, |
|
4aa4664b0343
replace extract-text-webpack-plugin (deprecated) by mini-css-extract-plugin. Try to make webpack-dev-server work again on the project
ymh <ymh.work@gmail.com>
parents:
539
diff
changeset
|
56 |
localIdentName: '[local]', |
|
4aa4664b0343
replace extract-text-webpack-plugin (deprecated) by mini-css-extract-plugin. Try to make webpack-dev-server work again on the project
ymh <ymh.work@gmail.com>
parents:
539
diff
changeset
|
57 |
importLoaders: 1 |
|
4aa4664b0343
replace extract-text-webpack-plugin (deprecated) by mini-css-extract-plugin. Try to make webpack-dev-server work again on the project
ymh <ymh.work@gmail.com>
parents:
539
diff
changeset
|
58 |
} |
|
4aa4664b0343
replace extract-text-webpack-plugin (deprecated) by mini-css-extract-plugin. Try to make webpack-dev-server work again on the project
ymh <ymh.work@gmail.com>
parents:
539
diff
changeset
|
59 |
}, |
|
4aa4664b0343
replace extract-text-webpack-plugin (deprecated) by mini-css-extract-plugin. Try to make webpack-dev-server work again on the project
ymh <ymh.work@gmail.com>
parents:
539
diff
changeset
|
60 |
{ |
|
4aa4664b0343
replace extract-text-webpack-plugin (deprecated) by mini-css-extract-plugin. Try to make webpack-dev-server work again on the project
ymh <ymh.work@gmail.com>
parents:
539
diff
changeset
|
61 |
loader: 'resolve-url-loader' |
|
4aa4664b0343
replace extract-text-webpack-plugin (deprecated) by mini-css-extract-plugin. Try to make webpack-dev-server work again on the project
ymh <ymh.work@gmail.com>
parents:
539
diff
changeset
|
62 |
}, |
|
4aa4664b0343
replace extract-text-webpack-plugin (deprecated) by mini-css-extract-plugin. Try to make webpack-dev-server work again on the project
ymh <ymh.work@gmail.com>
parents:
539
diff
changeset
|
63 |
{ |
|
4aa4664b0343
replace extract-text-webpack-plugin (deprecated) by mini-css-extract-plugin. Try to make webpack-dev-server work again on the project
ymh <ymh.work@gmail.com>
parents:
539
diff
changeset
|
64 |
loader: 'postcss-loader' |
|
4aa4664b0343
replace extract-text-webpack-plugin (deprecated) by mini-css-extract-plugin. Try to make webpack-dev-server work again on the project
ymh <ymh.work@gmail.com>
parents:
539
diff
changeset
|
65 |
}, |
|
4aa4664b0343
replace extract-text-webpack-plugin (deprecated) by mini-css-extract-plugin. Try to make webpack-dev-server work again on the project
ymh <ymh.work@gmail.com>
parents:
539
diff
changeset
|
66 |
{ |
|
4aa4664b0343
replace extract-text-webpack-plugin (deprecated) by mini-css-extract-plugin. Try to make webpack-dev-server work again on the project
ymh <ymh.work@gmail.com>
parents:
539
diff
changeset
|
67 |
loader: 'sass-loader' |
|
4aa4664b0343
replace extract-text-webpack-plugin (deprecated) by mini-css-extract-plugin. Try to make webpack-dev-server work again on the project
ymh <ymh.work@gmail.com>
parents:
539
diff
changeset
|
68 |
}], |
|
539
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
69 |
include: [ |
|
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
70 |
path.join(__dirname, '/src'), |
|
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
71 |
/node_modules/ |
|
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
72 |
] |
|
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
73 |
}, |
|
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
74 |
{ |
|
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
75 |
test: /\.js$/, |
|
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
76 |
use: [{ |
|
146
f912b591e1c1
new src_js folder
Harris Baptiste <harris.baptiste@iri.centrepompidou.fr>
parents:
diff
changeset
|
77 |
loader: 'babel-loader', |
|
539
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
78 |
options: { |
|
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
79 |
presets: ['es2015'], |
|
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
80 |
plugins: ['transform-es2015-shorthand-properties', 'lodash'] |
|
146
f912b591e1c1
new src_js folder
Harris Baptiste <harris.baptiste@iri.centrepompidou.fr>
parents:
diff
changeset
|
81 |
} |
|
539
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
82 |
}], |
|
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
83 |
exclude: /node_modules/, |
|
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
84 |
include: [ |
|
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
85 |
path.join(projectRoot, 'src') |
|
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
86 |
] |
|
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
87 |
}, |
|
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
88 |
{ |
|
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
89 |
test: /\.(png|jpg|gif|svg)$/, |
|
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
90 |
loader: 'file-loader', |
|
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
91 |
query: { |
|
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
92 |
name: '[name].[ext]?[hash]' |
|
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
93 |
} |
|
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
94 |
}, |
|
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
95 |
{ |
|
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
96 |
test: /\.(ttf|eot|svg|woff|woff2)(\?v=[0-9]\.[0-9]\.[0-9])?$/, |
|
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
97 |
loader: 'file-loader?name=[name].[ext]&publicPath=../fonts/&outputPath=iconolab/fonts/' |
|
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
98 |
}, |
|
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
99 |
{ |
|
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
100 |
test: require.resolve('snapsvg'), |
|
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
101 |
loader: 'imports-loader?this=>window,fix=>module.exports=0' |
|
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
102 |
}, |
|
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
103 |
{ |
|
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
104 |
test: require.resolve('jquery'), |
|
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
105 |
use: [{ |
|
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
106 |
loader: 'expose-loader', |
|
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
107 |
options: 'JQuery' |
|
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
108 |
}, { |
|
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
109 |
loader: 'expose-loader', |
|
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
110 |
options: '$' |
|
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
111 |
}] |
|
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
112 |
}, |
|
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
113 |
{ |
|
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
114 |
test: require.resolve('vue/dist/vue.min'), |
|
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
115 |
use: [{ |
|
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
116 |
loader: 'expose-loader', |
|
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
117 |
options: 'Vue' |
|
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
118 |
}] |
|
541
4aa4664b0343
replace extract-text-webpack-plugin (deprecated) by mini-css-extract-plugin. Try to make webpack-dev-server work again on the project
ymh <ymh.work@gmail.com>
parents:
539
diff
changeset
|
119 |
}, |
|
4aa4664b0343
replace extract-text-webpack-plugin (deprecated) by mini-css-extract-plugin. Try to make webpack-dev-server work again on the project
ymh <ymh.work@gmail.com>
parents:
539
diff
changeset
|
120 |
{ |
|
4aa4664b0343
replace extract-text-webpack-plugin (deprecated) by mini-css-extract-plugin. Try to make webpack-dev-server work again on the project
ymh <ymh.work@gmail.com>
parents:
539
diff
changeset
|
121 |
test: require.resolve('lodash/core'), |
|
4aa4664b0343
replace extract-text-webpack-plugin (deprecated) by mini-css-extract-plugin. Try to make webpack-dev-server work again on the project
ymh <ymh.work@gmail.com>
parents:
539
diff
changeset
|
122 |
use: [{ |
|
4aa4664b0343
replace extract-text-webpack-plugin (deprecated) by mini-css-extract-plugin. Try to make webpack-dev-server work again on the project
ymh <ymh.work@gmail.com>
parents:
539
diff
changeset
|
123 |
loader: 'expose-loader', |
|
4aa4664b0343
replace extract-text-webpack-plugin (deprecated) by mini-css-extract-plugin. Try to make webpack-dev-server work again on the project
ymh <ymh.work@gmail.com>
parents:
539
diff
changeset
|
124 |
options: '_' |
|
4aa4664b0343
replace extract-text-webpack-plugin (deprecated) by mini-css-extract-plugin. Try to make webpack-dev-server work again on the project
ymh <ymh.work@gmail.com>
parents:
539
diff
changeset
|
125 |
}] |
|
539
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
126 |
} |
|
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
127 |
]}, |
|
309
c5b524696fb3
Improve JS/CSS compilation.
Alexandre Segura <mex.zktk@gmail.com>
parents:
299
diff
changeset
|
128 |
plugins: [ |
|
541
4aa4664b0343
replace extract-text-webpack-plugin (deprecated) by mini-css-extract-plugin. Try to make webpack-dev-server work again on the project
ymh <ymh.work@gmail.com>
parents:
539
diff
changeset
|
129 |
new MiniCssExtractPlugin({ filename: 'iconolab/css/[name].css' }), |
|
539
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
130 |
new VueLoaderPlugin(), |
|
309
c5b524696fb3
Improve JS/CSS compilation.
Alexandre Segura <mex.zktk@gmail.com>
parents:
299
diff
changeset
|
131 |
new webpack.ProvidePlugin({ |
|
539
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
132 |
$: 'jquery', |
|
541
4aa4664b0343
replace extract-text-webpack-plugin (deprecated) by mini-css-extract-plugin. Try to make webpack-dev-server work again on the project
ymh <ymh.work@gmail.com>
parents:
539
diff
changeset
|
133 |
jQuery: 'jquery' |
|
539
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
134 |
}), |
|
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
135 |
new LodashModuleReplacementPlugin(), |
|
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
136 |
new webpack.ContextReplacementPlugin(/moment[\/\\]locale$/, /fr/) |
|
309
c5b524696fb3
Improve JS/CSS compilation.
Alexandre Segura <mex.zktk@gmail.com>
parents:
299
diff
changeset
|
137 |
], |
|
146
f912b591e1c1
new src_js folder
Harris Baptiste <harris.baptiste@iri.centrepompidou.fr>
parents:
diff
changeset
|
138 |
devServer: { |
|
309
c5b524696fb3
Improve JS/CSS compilation.
Alexandre Segura <mex.zktk@gmail.com>
parents:
299
diff
changeset
|
139 |
port: 8001, |
|
541
4aa4664b0343
replace extract-text-webpack-plugin (deprecated) by mini-css-extract-plugin. Try to make webpack-dev-server work again on the project
ymh <ymh.work@gmail.com>
parents:
539
diff
changeset
|
140 |
contentBase: '.', |
|
309
c5b524696fb3
Improve JS/CSS compilation.
Alexandre Segura <mex.zktk@gmail.com>
parents:
299
diff
changeset
|
141 |
publicPath: '/static/', |
|
c5b524696fb3
Improve JS/CSS compilation.
Alexandre Segura <mex.zktk@gmail.com>
parents:
299
diff
changeset
|
142 |
stats: 'minimal', |
|
c5b524696fb3
Improve JS/CSS compilation.
Alexandre Segura <mex.zktk@gmail.com>
parents:
299
diff
changeset
|
143 |
compress: true, |
|
539
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
144 |
headers: { |
|
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
145 |
'Access-Control-Allow-Origin': '*' |
|
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
146 |
}, |
|
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
147 |
historyApiFallback: true |
|
146
f912b591e1c1
new src_js folder
Harris Baptiste <harris.baptiste@iri.centrepompidou.fr>
parents:
diff
changeset
|
148 |
}, |
|
539
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
149 |
devtool: '#source-map', |
|
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
150 |
performance: { hints: false }, |
|
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
151 |
optimization: { |
|
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
152 |
splitChunks: { // CommonsChunkPlugin() |
|
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
153 |
name: 'vendor' |
|
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
154 |
}, |
|
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
155 |
minimizer: [ |
|
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
156 |
new UglifyJsPlugin({ |
|
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
157 |
uglifyOptions: { |
|
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
158 |
ie8: false, |
|
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
159 |
mangle: true, |
|
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
160 |
output: { |
|
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
161 |
comments: false, |
|
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
162 |
beautify: false |
|
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
163 |
}, |
|
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
164 |
compress: true, |
|
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
165 |
warnings: false, |
|
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
166 |
ecma: 6 |
|
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
167 |
}, |
|
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
168 |
sourceMap: true |
|
541
4aa4664b0343
replace extract-text-webpack-plugin (deprecated) by mini-css-extract-plugin. Try to make webpack-dev-server work again on the project
ymh <ymh.work@gmail.com>
parents:
539
diff
changeset
|
169 |
}), |
|
4aa4664b0343
replace extract-text-webpack-plugin (deprecated) by mini-css-extract-plugin. Try to make webpack-dev-server work again on the project
ymh <ymh.work@gmail.com>
parents:
539
diff
changeset
|
170 |
new OptimizeCSSAssetsPlugin({}) |
|
539
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
171 |
] |
|
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
172 |
} |
|
146
f912b591e1c1
new src_js folder
Harris Baptiste <harris.baptiste@iri.centrepompidou.fr>
parents:
diff
changeset
|
173 |
} |
|
f912b591e1c1
new src_js folder
Harris Baptiste <harris.baptiste@iri.centrepompidou.fr>
parents:
diff
changeset
|
174 |
|
|
f912b591e1c1
new src_js folder
Harris Baptiste <harris.baptiste@iri.centrepompidou.fr>
parents:
diff
changeset
|
175 |
if (process.env.NODE_ENV === 'production') { |
|
539
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
176 |
module.exports.mode = 'production' |
|
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
177 |
module.exports.devtool = false |
|
146
f912b591e1c1
new src_js folder
Harris Baptiste <harris.baptiste@iri.centrepompidou.fr>
parents:
diff
changeset
|
178 |
// http://vue-loader.vuejs.org/en/workflow/production.html |
|
f912b591e1c1
new src_js folder
Harris Baptiste <harris.baptiste@iri.centrepompidou.fr>
parents:
diff
changeset
|
179 |
module.exports.plugins = (module.exports.plugins || []).concat([ |
|
f912b591e1c1
new src_js folder
Harris Baptiste <harris.baptiste@iri.centrepompidou.fr>
parents:
diff
changeset
|
180 |
new webpack.DefinePlugin({ |
|
f912b591e1c1
new src_js folder
Harris Baptiste <harris.baptiste@iri.centrepompidou.fr>
parents:
diff
changeset
|
181 |
'process.env': { |
|
539
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
182 |
'NODE_ENV': '"production"' |
|
146
f912b591e1c1
new src_js folder
Harris Baptiste <harris.baptiste@iri.centrepompidou.fr>
parents:
diff
changeset
|
183 |
} |
|
539
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
184 |
}) |
|
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
185 |
]) |
|
541
4aa4664b0343
replace extract-text-webpack-plugin (deprecated) by mini-css-extract-plugin. Try to make webpack-dev-server work again on the project
ymh <ymh.work@gmail.com>
parents:
539
diff
changeset
|
186 |
} else if (process.env.NODE_ENV === 'bundlesize') { |
|
539
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
187 |
module.exports.mode = 'development' |
|
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
188 |
module.exports.plugins = (module.exports.plugins || []).concat([ |
|
08e2513dbc2f
Upgrade webpack to 4, upgrade vue.js, and some style changes
ymh <ymh.work@gmail.com>
parents:
418
diff
changeset
|
189 |
new BundleAnalyzerPlugin() |
|
146
f912b591e1c1
new src_js folder
Harris Baptiste <harris.baptiste@iri.centrepompidou.fr>
parents:
diff
changeset
|
190 |
]) |
|
541
4aa4664b0343
replace extract-text-webpack-plugin (deprecated) by mini-css-extract-plugin. Try to make webpack-dev-server work again on the project
ymh <ymh.work@gmail.com>
parents:
539
diff
changeset
|
191 |
} else { |
|
4aa4664b0343
replace extract-text-webpack-plugin (deprecated) by mini-css-extract-plugin. Try to make webpack-dev-server work again on the project
ymh <ymh.work@gmail.com>
parents:
539
diff
changeset
|
192 |
module.exports.mode = 'development' |
|
146
f912b591e1c1
new src_js folder
Harris Baptiste <harris.baptiste@iri.centrepompidou.fr>
parents:
diff
changeset
|
193 |
} |