webpack3.0写的
const path = require('path');
module.exports = {
//webpack打包入口
entry: './src/script/main.js',
//打包文件放的位置
output: {
path: path.resolve(__dirname, "/dist/js"),
filename: 'bundle.js'
}
}
const path = require('path');
module.exports = {
//webpack打包入口
entry: './src/script/main.js',
//打包文件放的位置
output: {
path: path.resolve(__dirname, "/dist/js"),
filename: 'bundle.js'
}
}
2017-07-05
貌似postcss-import就是让@import引入的css与style引入的css进行合并的并且不会添加前缀,然而,@import引入的css前缀怎么添加?还没没弄出来!
2017-07-04
{
test:/\.css$/,
use: ['style-loader','css-loader',{
loader:'postcss-loader',
options:{
plugins:[
require('autoprefixer')
]
}
}]
}
test:/\.css$/,
use: ['style-loader','css-loader',{
loader:'postcss-loader',
options:{
plugins:[
require('autoprefixer')
]
}
}]
}
2017-07-04
module: {
rules:[
{ test:/\.js$/,
use:{
loader:'babel-loader',
options:{
presets:['env']
}
},
exclude: /node_modules/,
include:__dirname+'/src/', } ]}
rules:[
{ test:/\.js$/,
use:{
loader:'babel-loader',
options:{
presets:['env']
}
},
exclude: /node_modules/,
include:__dirname+'/src/', } ]}
2017-07-03
我用的webpack3.0,先安装插件npm install postcss-import,具体配置:
{test:/\.css$/,
use:['style-loader','css-loader',
{loader:'postcss-loader',
options:{
plugins:(loader)=>[
require('postcss-import')({root:loader.resourcePath}),
require('autoprefixer')()]}}]}
{test:/\.css$/,
use:['style-loader','css-loader',
{loader:'postcss-loader',
options:{
plugins:(loader)=>[
require('postcss-import')({root:loader.resourcePath}),
require('autoprefixer')()]}}]}
2017-07-02