Last active
February 12, 2018 06:56
-
-
Save SeonghuiChoe/e1c683da298d9fd74281198951ed5c16 to your computer and use it in GitHub Desktop.
webpack.config.js version1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const webpack = require('webpack'); | |
module.exports = { | |
entry: './webpack.js', | |
output: { | |
path: __dirname + '/dist/', | |
filename: 'bundle.js', | |
}, | |
module: { | |
rules: [{ | |
test: /\.css$/, | |
use: [ | |
'style-loader', | |
'css-loader' | |
] | |
}, | |
{ | |
test: /\.(png|woff|woff2|eot|ttf|svg)$/, | |
use: { | |
loader: 'url-loader', | |
options: { | |
name: '[name].[ext]?[hash]', | |
publicPath: './dist/', | |
limit: 100000 // 10kb | |
} | |
} | |
}] | |
}, | |
plugins: [ | |
new webpack.optimize.UglifyJsPlugin() | |
] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const webpack = require('webpack'); | |
module.exports = { | |
entry: './webpack.js', | |
output: { | |
path: __dirname + '/dist/', | |
filename: 'bundle.js', | |
}, | |
module: { | |
rules: [{ | |
test: /\.css$/, | |
loader: 'style-loader!css-loader?sourceMap' | |
}, | |
{ | |
test: /\.(png|woff|woff2|eot|ttf|svg)$/, | |
loader: 'url-loader?limit=100000&name=font/[name]_[hash:base64:5].[ext]&publicPath=./dist/' }] | |
}, | |
plugins: [ | |
new webpack.optimize.UglifyJsPlugin() | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment