这个是意思没找到index.js或者template.html的意思吗?

来源:3-1 一点小准备-单独讲解vue核心内容的配置

huaichaoer

2018-11-05

图片描述

package.json文件中的内容是直接拷贝老师的
其他的也是按老师的写的 不知道为啥会这样(没有报错)

写回答

2回答

huaichaoer

提问者

2018-11-06

const path = require('path')

const HTMLPlugin = require('html-webpack-plugin')

const webpack = require('webpack')

const merge = require('webpack-merge')

const baseConfig = require('./webpack.config.base')


const defaultPluins = [

new webpack.DefinePlugin({

'process.env': {

NODE_ENV: '"development"'

}

}),

new HTMLPlugin({

template: path.join(__dirname, 'template.html')

})

]


const devServer = {

port: 8080,

host: '0.0.0.0',

overlay: {

errors: true

},

hot: true

}


let config


config = merge(baseConfig, {

entry: path.join(__dirname, '../practice/index.js'),

devtool: '#cheap-module-eval-source-map',

module: {

rules: [

{

test: /\.styl/,

use: [

'vue-style-loader',

'css-loader',

{

loader: 'postcss-loader',

options: {

sourceMap: true

}

},

'stylus-loader'

]

}

]

},

devServer,

// import Vue from 'vue'

resolve: {

alias: {

'vue': path.join(__dirname, '../node_modules/vue/dist/vue.esm.js')

}

},

plugins: defaultPluins.concat([

new webpack.HotModuleReplacementPlugin(),

new webpack.NoEmitOnErrorsPlugin()

])

})


module.exports = config


0
0

Jokcy

2018-11-06

devServer中的historyApiFallback配置了么?把配置贴出来吧

0
5
huaichaoer
回复
Jokcy
老师您有新的包吗?好歹我先把项目跑起来
2018-11-07
共5条回复

Vue核心技术 Vue+Vue-Router+Vuex+SSR实战精讲

深入讲解Vue核心技术,展示Vue应用开发中的各种问题和解决方案

3168 学习 · 853 问题

查看课程