Created
February 23, 2020 10:00
-
-
Save Juszczak/64a800c0a41b600abfebbfe8f07c4fdf to your computer and use it in GitHub Desktop.
This file contains hidden or 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 HtmlWebpackPlugin = require('html-webpack-plugin'); | |
const CopyWebpackPlugin = require('copy-webpack-plugin'); | |
const isProduction = !!process.env.WEBPACK_PRODUCTION; | |
console.log('isProduction:', typeof isProduction); | |
const htmlPluginConfig = {template: './src/index.html'}; | |
const htmlPlugin = new HtmlWebpackPlugin(htmlPluginConfig) | |
const copyPlugin = new CopyWebpackPlugin([{ | |
from: './src/style.css' | |
}]); | |
module.exports = { | |
entry: './src/main.js', | |
output: { | |
path: __dirname + '/dist', | |
filename: '[name].js' | |
}, | |
plugins: [htmlPlugin, copyPlugin], | |
mode: isProduction ? 'production' : 'development' | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment