Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const path = require('path');
- const ExtractTextPlugin = require('extract-text-webpack-plugin');
- const HtmlWebpackPlugin = require('html-webpack-plugin');
- const CleanWebpackPlugin = require('clean-webpack-plugin');
- module.exports = {
- entry: {
- app: ['babel-polyfill', './src/js/app.js']
- },
- output: {
- path: path.resolve(__dirname, 'dist'),
- filename: 'bundle.js'
- },
- module: {
- rules: [
- {
- test: /\.js$/,
- exclude: /node_modules/,
- use: [
- {
- loader: 'babel-loader',
- options: {
- presets: ['env']
- }
- }
- ]
- },
- {
- test: /\.sass$/,
- use: ExtractTextPlugin.extract({
- use: ['css-loader', 'sass-loader']
- })
- },
- {
- test: /\.(gif|png|jpe?g|svg)$/i,
- use: [
- "file-loader",
- {
- loader: "image-webpack-loader",
- options: {
- outputPath: 'img/',
- bypassOnDebug: true
- }
- }
- ]
- }
- ]
- },
- plugins: [
- new ExtractTextPlugin({filename: 'main.css'}),
- new HtmlWebpackPlugin({
- inject: true,
- hash: true,
- template: './src/index.html',
- filename: 'index.html'
- }),
- new CleanWebpackPlugin('dist', {} )
- ]
- };
Add Comment
Please, Sign In to add comment