其他分享
首页 > 其他分享> > externals拒绝被打包进来

externals拒绝被打包进来

作者:互联网

const { resolve } = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');

module.exports = {
  entry: './src/js/index.js',
  output: {
    filename: 'js/built.js',
    path: resolve(__dirname, 'build')
  },
  plugins: [
    new HtmlWebpackPlugin({
      template: './src/index.html'
    })
  ],
  mode: 'production',
  externals: {
    // 拒绝jQuery被打包进来
    jquery: 'jQuery'
  }
};

 

标签:jQuery,index,const,拒绝,externals,js,HtmlWebpackPlugin,打包
来源: https://www.cnblogs.com/yyy1234/p/16218641.html