Created
March 9, 2020 14:58
-
-
Save lagagain/d37cfec205251779df36a33be77db969 to your computer and use it in GitHub Desktop.
This file contains 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 webpack = require('webpack'); | |
const path = require('path'); | |
const config = { | |
mode: 'development', | |
entry:{ | |
index: "./src/index.js", | |
}, | |
output:{ | |
path: path.resolve(__dirname, "dist"), | |
filename: '[name].js', | |
}, | |
//publicPath: "./", | |
module: { | |
rules: [ | |
{ | |
test: /\.js$/, | |
exclude: /(node_modules|bower_components)/, | |
use: { | |
loader: 'babel-loader', | |
options: { | |
presets: ['@babel/preset-env'], | |
//plugins: [require('@babel/plugin-transform-object-rest-spread')] | |
} | |
} | |
}, { | |
test: /\.css$/, | |
include: [ | |
path.resolve(__dirname, "public") | |
], | |
exclude: /(node_modules|bower_components)/, | |
use: ['style-loader', 'css-loader'], | |
},{ | |
test: /\.less$/, | |
loader: 'less-loader', | |
}, | |
] | |
}, | |
plugins: [ | |
new HtmlWebpackPlugin({ | |
index: './public/index.html' | |
}) | |
] | |
}; | |
module.exports = config; | |
//npm install --save-dev [email protected] @babel/core @babel/preset-env webpack | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment