在vue和webpack搭建的项目中,webpack目录没有dev-server.js,如何创建本地的express服务器?
现在的文档目录
目录没有dev-server.js是什么意思?dev-server是webpack创建的一个服务器,只有webpack配置正确,就会创建
dev: {
// Paths
assetsSubDirectory: 'static',
assetsPublicPath: '/',
headers: {
'Access-Control-Allow-Origin': '*'
},
// Various Dev Server settings
// host: 'liushaobo11.m.itcloudlab.vm', // can be overwritten by process.env.HOST
// host: 'node.itcloudlab.vm', // can be overwritten by process.env.HOST
host: '0.0.0.0', // can be overwritten by process.env.HOST
port: 9090, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
autoOpenBrowser: false,
// disableHostCheck: true,
// public: 'node.itcloudlab.vm',
errorOverlay: true,
notifyOnErrors: true,
poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions-
// Use Eslint Loader?
// If true, your code will be linted during bundling and
// linting errors and warnings will be shown in the console.
useEslint: true,
// If true, eslint errors and warnings will also be shown in the error overlay
// in the browser.
showEslintErrorsInOverlay: false,
/**
* Source Maps
*/
// https://webpack.js.org/configuration/devtool/#development
devtool: 'eval-source-map',
// If you have problems debugging vue-files in devtools,
// set this to false - it *may* help
// https://vue-loader.vuejs.org/en/options.html#cachebusting
cacheBusting: true,
// CSS Sourcemaps off by default because relative paths are "buggy"
// with this option, according to the CSS-Loader README
// (https://github.com/webpack/css-loader#sourcemaps)
// In our experience, they generally work as expected,
// just be aware of this issue when enabling this option.
cssSourceMap: false,
},
2 回答871 阅读✓ 已解决
2 回答913 阅读
1 回答949 阅读
817 阅读
717 阅读
584 阅读
把你现在的目录截个图贴上来
{
"name": "sy-moblie",
"version": "1.0.0",
"description": "sy vue project",
"author": "Jay",
"private": true,
"scripts": {
},
"dependencies": {
},