-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.dist.js
37 lines (31 loc) · 953 Bytes
/
webpack.dist.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
'use strict'
const path = require('path')
const webpack = require('webpack')
const ExtractTextPlugin = require('extract-text-webpack-plugin')
const HtmlWebpackIncludeAssetsPlugin = require('html-webpack-include-assets-plugin')
const baseDir = process.cwd()
let g4uPackageInfo = require(path.join(baseDir, 'package.json'))
if (g4uPackageInfo.name !== 'guide4you') {
g4uPackageInfo = require(path.join(baseDir, 'node_modules/guide4you/package.json'))
}
const g4uVersion = g4uPackageInfo.version
module.exports = {
plugins: [
new webpack.DefinePlugin({ SWITCH_DEBUG: '\'PRODUCTION\'', GUIDE4YOU_VERSION: '\'v' + g4uVersion + '\'' }),
new ExtractTextPlugin({
filename: 'css/[name].css'
}),
new HtmlWebpackIncludeAssetsPlugin({
assets: [
'../node_modules/jquery/dist/jquery.min.js'
],
append: false
})
],
optimization: {
minimize: true
},
output: {
filename: 'js/[name].js'
}
}