課程
/前端開發
/Vue.js
/vue.js入門基礎
我用的是fis3前端構建工具,fis3他會默認的占用8080端口,如果端口被占用的了話,npm run dev 也會報錯的?
2016-11-28
源自:vue.js入門基礎
正在回答
是fis3的熱更新監聽8080嗎?
vue-cli里基本包括了這些功能,我認為沒必要再用fis3,不知道你用fis3的目的是什么?
如果非要用,你可以在config里找到項目的端口改一下。
config/index.js
// see http://vuejs-templates.github.io/webpack for documentation.
var path = require('path')
module.exports = {
? build: {
? ? env: require('./prod.env'),
? ? index: path.resolve(__dirname, '../dist/index.html'),
? ? assetsRoot: path.resolve(__dirname, '../dist'),
? ? assetsSubDirectory: 'static',
? ? assetsPublicPath: '/',
? ? productionSourceMap: true,
? ? // Gzip off by default as many popular static hosts such as
? ? // Surge or Netlify already gzip all static assets for you.
? ? // Before setting to `true`, make sure to:
? ? // npm install --save-dev compression-webpack-plugin
? ? productionGzip: false,
? ? productionGzipExtensions: ['js', 'css']
? },
? dev: {
? ? env: require('./dev.env'),
? ? port: 8080,
? ? proxyTable: {},
? ? // 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
? }
}
在config文件里修改端口?
舉報
本門為vuejs入門教程,詳細的講解加實戰,可以幫你進入vuejs的大門
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網安備11010802030151號
購課補貼聯系客服咨詢優惠詳情
慕課網APP您的移動學習伙伴
掃描二維碼關注慕課網微信公眾號
2016-11-29
是fis3的熱更新監聽8080嗎?
vue-cli里基本包括了這些功能,我認為沒必要再用fis3,不知道你用fis3的目的是什么?
如果非要用,你可以在config里找到項目的端口改一下。
config/index.js
// see http://vuejs-templates.github.io/webpack for documentation.
var path = require('path')
module.exports = {
? build: {
? ? env: require('./prod.env'),
? ? index: path.resolve(__dirname, '../dist/index.html'),
? ? assetsRoot: path.resolve(__dirname, '../dist'),
? ? assetsSubDirectory: 'static',
? ? assetsPublicPath: '/',
? ? productionSourceMap: true,
? ? // Gzip off by default as many popular static hosts such as
? ? // Surge or Netlify already gzip all static assets for you.
? ? // Before setting to `true`, make sure to:
? ? // npm install --save-dev compression-webpack-plugin
? ? productionGzip: false,
? ? productionGzipExtensions: ['js', 'css']
? },
? dev: {
? ? env: require('./dev.env'),
? ? port: 8080,
? ? assetsSubDirectory: 'static',
? ? assetsPublicPath: '/',
? ? proxyTable: {},
? ? // 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
? }
}
2017-01-16
在config文件里修改端口?
2016-11-28
我用的是fis3前端構建工具,fis3他會默認的占用8080端口,如果端口被占用的了話,npm run dev 也會報錯的?