[vue]使用webpack打包
使用webpack打包 hello.js暴露方法 exports.hello = function () { document.write("<h1>hello</h1>"); } main.js入口 var hello = require("./hello"); hello.hello(); webpack.config.js打包配置 module.exports = { entry: './modules/main.js', output: { filename: './js/bundle.js' } }; 生成的bundle.js !function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object