-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpackfile.compressed.js
50 lines (48 loc) · 1.32 KB
/
webpackfile.compressed.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
// 仅压缩 - 不分离样式,压缩打包的js,命名为min.js,不监听改动
const webpack = require('webpack')
const path = require('path')
const fs = require('fs')
const INPUT_PATH = path.join(__dirname, '/_javascripts')
const OUTPUT_PATH = path.join(__dirname, '/')
module.exports = {
entry: path.resolve(__dirname, INPUT_PATH, 'entry.js'),
output: {
path: path.resolve(__dirname, OUTPUT_PATH),
filename: 'jqueryMaterial.min.js',
},
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
options: {
presets: ['es2015'],
},
},
},
{
test: /\.css$/,
use: {
loader: 'css-loader'
}
},
{
test: /\.scss$/,
use: ['style-loader', 'css-loader', 'sass-loader']
},
{
test: /\.(jpg|png|ttf|svg)$/,
use: {
loader: 'url-loader',
},
},
],
},
plugins: [
new webpack.optimize.UglifyJsPlugin({
sourceMap: true,
}),
]
}