課程
/前端開(kāi)發(fā)
/前端工具
/Vue+Webpack打造todo應(yīng)用
怎么回事…………
2018-09-07
源自:Vue+Webpack打造todo應(yīng)用 2-1
正在回答
我找到了答案,分享給大家。
只要修改webpack.config.js就可以打包了。
const path = require('path');? ?
const {VueLoaderPlugin}=require('vue-loader');??
????module.exports = {
????????entry: path.resolve(__dirname, "src/index.js"),? ?//webpack4官方絕對(duì)路徑
????devServer: {
????????contentBase: './dist'
????},
????output: {
????filename: 'bundle.js',
????????path: path.resolve(__dirname, 'dist')
????module: {
????rules: [
????????{
test: /\.vue$/,
use: [
'vue-loader'????????
]
},
{
test: /\.css$/,
'vue-style-loader',????????????????//可以不要
'style-loader',????????????????????????
'css-loader'
plugins:[
new VueLoaderPlugin()
};
關(guān)機(jī)重啟就好了
舉報(bào)
用前端最熱門(mén)框架Vue+最火打包工具Webpack打造todo應(yīng)用
2 回答npm run build報(bào)錯(cuò)
1 回答npm run build報(bào)錯(cuò)
1 回答npm run build 報(bào)錯(cuò)
4 回答npm run build報(bào)錯(cuò)
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號(hào)-11 京公網(wǎng)安備11010802030151號(hào)
購(gòu)課補(bǔ)貼聯(lián)系客服咨詢優(yōu)惠詳情
慕課網(wǎng)APP您的移動(dòng)學(xué)習(xí)伙伴
掃描二維碼關(guān)注慕課網(wǎng)微信公眾號(hào)
2018-09-14
我找到了答案,分享給大家。
只要修改webpack.config.js就可以打包了。
const path = require('path');? ?
const {VueLoaderPlugin}=require('vue-loader');??
????module.exports = {
????????entry: path.resolve(__dirname, "src/index.js"),? ?//webpack4官方絕對(duì)路徑
????devServer: {
????????contentBase: './dist'
????},
????output: {
????filename: 'bundle.js',
????????path: path.resolve(__dirname, 'dist')
????},
????module: {
????rules: [
????????{
test: /\.vue$/,
use: [
'vue-loader'????????
]
},
{
test: /\.css$/,
use: [
'vue-style-loader',????????????????//可以不要
'style-loader',????????????????????????
'css-loader'
]
},
]
},
plugins:[
new VueLoaderPlugin()
]
};
2018-09-07
關(guān)機(jī)重啟就好了