打包報(bào)錯(cuò)Unexpected character '#' (1:0)You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file.
打包報(bào)錯(cuò)Unexpected character '#' (1:0)You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file.
2020-03-10
app.vue報(bào)錯(cuò)
原因:
css的id符號無法識別。需要css-loader進(jìn)行解析
const path = require('path')
const VueLoaderPlugin = require('vue-loader/lib/plugin')
module.exports = {
? entry: path.join(__dirname,'src/index.js'),
? output: {
? ? filename: 'bundle.js',
? ? path: path.join(__dirname,'dist')
? },
? plugins:[
? ? new VueLoaderPlugin()
? ],
? module: {
? ? rules: [
? ? ? {
? ? ? ? test: /\.vue$/,
? ? ? ? loader: 'vue-loader'
? ? ? },
? ? ? {
? ? ? ? test: /\.css$/,
? ? ? ? loader: ['style-loader','css-loader']
? ? ? }//加了css-loader
? ? ]
? }
}
2020-03-10
? .styl 文件沒有l(wèi)oader,按視頻的安裝一下。如果不行注意一下三個(gè)loader的順序。原因:因?yàn)?styl需要依次經(jīng)過stylus-loader, postcss-loader css-loader, style-loader編譯。因此需要按此順序配置
{
? test:/\.styl/,
? ? use:[
? ? ? 'style-loader',
? ? ? 'css-loader',
? ? ? {
? ? ? ? loader: 'postcss-loader',
? ? ? ? options: {
? ? ? ? ? sourceMap: true
? ? ? ? }
? ? ? },
? ? ? 'stylus-loader'
? ? ]
},
2020-02-25
他不是告訴你了嗎,你有個(gè)loader沒有裝