Skip to content

Instantly share code, notes, and snippets.

@SeonghuiChoe
Last active February 12, 2018 06:56
Show Gist options
  • Save SeonghuiChoe/e1c683da298d9fd74281198951ed5c16 to your computer and use it in GitHub Desktop.
Save SeonghuiChoe/e1c683da298d9fd74281198951ed5c16 to your computer and use it in GitHub Desktop.
webpack.config.js version1
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()
]
}
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