当前位置: 代码迷 >> 综合 >> webpack (1) webpack.config.js
  详细解决方案

webpack (1) webpack.config.js

热度:9   发布时间:2023-11-24 07:59:12.0
const HtmlWebpackPlugin = require('html-webpack-plugin'); //通过 npm 安装
const webpack = require('webpack'); //访问内置的插件
const path = require('path');const config = {entry: './path/to/my/entry/file.js',output: {filename: 'my-first-webpack.bundle.js',path: path.resolve(__dirname, 'dist')},module: {rules: [{test: /\.(js|jsx)$/,use: 'babel-loader'}]},plugins: [new webpack.optimize.UglifyJsPlugin(),new HtmlWebpackPlugin({template: './src/index.html'})]
};module.exports = config;
  相关解决方案