webpack 入门二 webpack.config.js 用配置打包js

//搭建环境------------------------------------------------------------
//package.json文件
npm init

//安装webpack
npm install webpack -g
npm install webpack-cli -g

//简单打包
webpack ./a.js   ./bundle.js

//插件
npm install html-webpack-plugin --save-dev
npm install css-loader style-loader --save-dev
npm install file-loader --save-dev
npm install url-loader --save-dev
npm install copy-webpack-plugin --save-dev

//打包

webpack --config webpack.config.js
webpack.config.js

module.exports = { entry: ‘./a.js‘, output: { filename: ‘./bundle.js‘ } };
a.js

const user = { name: ‘ligy‘, addren: ‘深圳市‘ } console.log(‘this is a‘,user) export default user;

 

 

webpack 入门二  webpack.config.js 用配置打包js

 

 webpack 入门二  webpack.config.js 用配置打包js

 

webpack 入门二 webpack.config.js 用配置打包js

上一篇:SqlSession与SqlSessionFactory到底是什么关系?


下一篇:powerDesign16通过PLSql中导出的建表语句,建立E-R图