-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.debug.js
41 lines (35 loc) · 1.07 KB
/
webpack.debug.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
'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 CopyWebpackPlugin = require('copy-webpack-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: '\'DEBUG\'', GUIDE4YOU_VERSION: '\'v' + g4uVersion + '\'' }),
new ExtractTextPlugin({
filename: 'css/[name]-debug.css'
}),
new CopyWebpackPlugin([
{ from: 'node_modules/jquery/dist/jquery.js', to: 'js/jquery.js' }
]),
new HtmlWebpackIncludeAssetsPlugin({
assets: [
'js/jquery.js'
],
append: false
})
],
optimization: {
minimize: false
},
output: {
filename: 'js/[name]-debug.js'
}
}