一、html-webpack-plugin 编译

1、只需要在入口处定义一个chunks,如我们定义一个fuck模块

entry: {
app: './src/main.js',
fuck: ['./src/utils/index.js', './src/utils/index2.js']
},

2、然后就可以在 html-webpack-plugin 插件配置处这样书写:

// https://github.com/ampedandwired/html-webpack-plugin
new HtmlWebpackPlugin({
filename: 'index.html',
template: 'index.html',
chunks: ['fuck'],
inject: true
}),

如果你使用的是vue-cli脚手架,那么在 webpack.dev.conf.js 、 webpack.prod.conf.js 都可以找到

二、如果你是使用vue-cli的脚手架

1、只需要将文件放入/static/中

2、然后在index.html中这样书写即可:

<script type="text/javascript" src="/static/fuck.js"></script>



最新文章

  1. dom 的介绍
  2. git stuff
  3. 关于OAUTH2.0的极品好文
  4. 自然语言6_treebank句子解析
  5. [Cocos2D-x For WP8]Label标签
  6. Python 深拷贝和浅拷贝
  7. TUXEDO错误解决方案
  8. gulp.watch监听文件
  9. iphone编程,使用代码结束程序
  10. ntpath join(path, *paths) 发生UnicodeDecodeError的Bug的解决方案
  11. contains选择器
  12. python中telnetlib模块的使用
  13. FusionCharts生成Flash图表常见问题FAQ
  14. spring mvc跨域(ajax post json)--filter方案
  15. 运行Myeclipse时,如何删除IVM窗口
  16. Python *args 和 **kwargs用法
  17. SSM框架整合(IntelliJ IDEA + maven + Spring + SpringMVC + MyBatis)
  18. 获取Ueditor里面的图片列表,地址绝对化
  19. 权限认证之OpenID-OP/RP
  20. jdk源码-&gt;集合-&gt;HashMap

热门文章

  1. iOS webservice SOAP 请求
  2. 通过16道练习学习Linq和Lambda
  3. MapReduce任务参数调优(转)
  4. go语言生成uuid
  5. jqPlot图表插件学习之数据节点高亮和光标提示
  6. excel单元格对齐方式
  7. 转 error while loading shared libraries: libmysqlclient.so.15: cannot open shared object file
  8. error:No buffer space available (maximum connections reached
  9. redis对key的基本操作
  10. asiHttpRequst 学习地址