💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
### src/bar.js ``` exports.info=function(str){ document.write(str); } ``` ### src/logic.js ``` exports.add=function(a,b){ return a+b; } ``` ### src/main.js ``` var bar= require('./bar'); var logic= require('./logic'); bar.info( 'Hello world!'+ logic.add(100,200)); ``` ### webpack.config.js ``` 和src同级目录, 读取src文件夹下的main.js把对应的js文件打包,打包后放入当前目录的dist文件夹下,打包后的 文件名为bundle.js var path = require("path"); module.exports = { entry: './src/main.js', output: { path: path.resolve(__dirname, './dist'), filename: 'bundle.js' } }; ``` ### 执行编译命令 ``` webpack ```