Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const path = require('path')
- const HtmlWebpackPlugin = require('html-webpack-plugin');
- const CopyWebpackPlugin = require('copy-webpack-plugin');
- module.exports = {
- entry: './src/index.js',
- output: {
- path: path.join(__dirname, '/dist'),
- filename: 'bundle.js',
- },
- resolve: {
- alias: {
- '@': path.resolve(__dirname, 'src/'),
- },
- },
- module: {
- rules: [
- {
- test: /\.js$/,
- exclude: /node_modules/,
- use: {
- loader: 'babel-loader'
- },
- },
- {
- test: /\.css$/,
- use: [
- {
- loader: 'style-loader',
- },
- {
- loader: 'css-loader',
- },
- {
- loader: 'sass-loader',
- options: {
- includePaths: ['./node_modules', './node_modules/bootstrap/scss'],
- }
- },
- ],
- },
- {
- test: /\.(png|woff|woff2|eot|ttf|svg)$/,
- use: {
- loader: 'url-loader'
- }
- },
- ],
- },
- plugins: [
- new HtmlWebpackPlugin({
- template: './src/index.html',
- }),
- new CopyWebpackPlugin([
- {
- from: 'static/*',
- to: 'dist/static'
- }
- ]),
- ],
- devServer: {
- host: '0.0.0.0',
- port: 8080
- },
- };
Add Comment
Please, Sign In to add comment