webpack.config.js 417 B

12345678910111213141516171819202122
  1. const HtmlWebPackPlugin = require("html-webpack-plugin");
  2. const htmlPlugin = new HtmlWebPackPlugin({
  3. template: "./src/index.html",
  4. filename: "./index.html"
  5. });
  6. module.exports = {
  7. mode: 'development',
  8. module: {
  9. rules: [{
  10. test: /\.js$/,
  11. exclude: /node_modules/,
  12. use: {
  13. loader: "babel-loader"
  14. }
  15. },
  16. {
  17. test: /\.css$/,
  18. use: ["style-loader", "css-loader"]
  19. }
  20. ]},
  21. plugins: [htmlPlugin]
  22. };