为什么我的layer.js不会自动加入@import './layer/layer.less'
var HtmlWebpackPlugin = require('html-webpack-plugin');
var path = require('path');
module.exports = {
entry:'./src/app.js',
output:{
path:__dirname+'/dist',
filename:'js/[name].bundle.js'
},
module:{
rules: [
{test: /\.css$/,
use: ['style-loader', 'css-loader', {
loader: 'postcss-loader',
options: {
plugins: [
require("autoprefixer")({browsers: ["last 5 versions"]})
]
}
}]
},
{test:/\.less$/,
use:['style-loader','css-loader',{
loader:'postcss-loader',
options:{
plugins:[
require('autoprefixer')({
browsers:['last 5 versions']
})
]
}
},
'less-loader'
]
}
],
loaders: [{
test: /\.js$/,
loader: 'babel-loader',
exclude: path.resolve(__dirname, 'node_modules'),
include: '/src/',
query: {
presets: ['es2016']
}
}]
},
plugins:[
new HtmlWebpackPlugin({
filename:'index.html',
template:'index.html',
inject:'body',
title:'this is index.html'
})
]
}