webpack打包js文件
1.安装node.js
2.新建空文件夹,输入npm init -y,生成package.json文件
3. npm install -D webpack webpack-cli
4.新建三个文件夹src、out、config
5.在config文件夹下新建webpack.config.js文件
const path = require(‘path‘) module.exports={ entry:{ index:‘./src/Cesium.js‘ }, output:{ filename:‘[name].js‘, path:path.resolve(__dirname,‘../out‘) } }
6.在package.json添加代码:"start": "webpack --config config/webpack.config.js"
7.运行npm run start就完成啦,在out文件中
相关推荐
yezitoo 2020-06-13
gufudhn 2020-06-06
gloria0 2020-10-26
yqoxygen 2020-06-02
不知道该写啥QAQ 2020-11-12
webfullStack 2020-11-09
Yvettre 2020-09-15
想做大牛的蜗牛 2020-10-30
gaojie0 2020-09-11
SelinaChan 2020-08-14
不知道该写啥QAQ 2020-08-09
gloria0 2020-08-09
不知道该写啥QAQ 2020-08-02
hline 2020-07-29
SelinaChan 2020-07-28
wangdianyong 2020-07-23
webpackvuees 2020-07-23
yqoxygen 2020-07-20