var path = require('path');module.exports = { entry: "./src/main.js",//入口文件 output: {//打包輸出的文件 path: __dirname, filename: "./dist/bundle.js" }, module: { loaders: [ { test: path.join(__dirname, 'src'), loader: 'babel-loader', query: { presets: ['es2015'] } } ] }}{ "name": "test", "version": "1.0.0", "description": "", "main": "index.js", "scripts": { "start": "webpack-dev-server", "test": "echo \"Error: no test specified\" && exit 1" }, "author": "", "license": "ISC", "devDependencies": { "babel-core": "^6.24.1", "babel-loader": "^6.4.1", "webpack": "^2.4.1" }}使用webpack命令打包沒(méi)有問(wèn)題 使用npm start打包 不報(bào)錯(cuò) 但是文件沒(méi)有打包出來(lái)沒(méi)有我要先執(zhí)行一遍webpack 把文件打包如出來(lái) 然后在執(zhí)行npm start 才可以熱加載更新
webpack-dev-server 打包沒(méi)有報(bào)錯(cuò) 但是沒(méi)有生成文件
大話(huà)西游666
2018-11-06 13:18:43