Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
This web pack config convert assets file (images and fonts) to base64
var webpack = require('webpack');
var path = require('path');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
module.exports = {
entry: './src/js/main.js',
output: {
path: path.resolve(__dirname, 'dist/'),
publicPath: 'dist/',
filename: 'bundle.js'
},
module: {
rules: [
{
test: /\.scss$/,
use: ExtractTextPlugin.extract({
fallback: 'style-loader',
use: [
{
loader: 'css-loader',
options: {
// minimize: true
}
},
{
loader: 'sass-loader'
},
]
})
},
{
test: /\.(png|jpg|jpeg|woff|woff2|eot|ttf|svg)$/,
loader: 'url-loader?limit=100000',
}
]
},
plugins: [
new ExtractTextPlugin('[name].css', { allChunks: true }),
]
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.