Created
January 29, 2016 21:09
-
-
Save vedovelli/bb098681849b9d10e240 to your computer and use it in GitHub Desktop.
webpack base config for vue cli with support for Bootstrap and Font-awesome
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var path = require('path') | |
module.exports = { | |
entry: { | |
app: './src/main.js' | |
}, | |
output: { | |
path: path.resolve(__dirname, '../dist/static'), | |
publicPath: '/static/', | |
filename: '[name].js' | |
}, | |
resolve: { | |
extensions: ['', '.js', '.vue'], | |
alias: { | |
'src': path.resolve(__dirname, '../src') | |
} | |
}, | |
resolveLoader: { | |
root: path.join(__dirname, 'node_modules') | |
}, | |
module: { | |
loaders: [ | |
{ | |
test: /\.vue$/, | |
loader: 'vue' | |
}, | |
{ | |
test: /\.js$/, | |
loader: 'babel!eslint', | |
exclude: /node_modules/ | |
}, | |
{ | |
test: /\.json$/, | |
loader: 'json' | |
}, | |
{ | |
test: /\.css$/, | |
loader: 'style!css' | |
}, | |
{ | |
test: /\.woff(\?v=\d+\.\d+\.\d+)?$/, | |
loader: "url?limit=10000&mimetype=application/font-woff" | |
}, | |
{ | |
test: /\.woff2(\?v=\d+\.\d+\.\d+)?$/, | |
loader: "url?limit=10000&mimetype=application/font-woff" | |
}, | |
{ | |
test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/, | |
loader: "url?limit=10000&mimetype=application/octet-stream" | |
}, | |
{ | |
test: /\.eot(\?v=\d+\.\d+\.\d+)?$/, | |
loader: "file" | |
},{ | |
test: /\.svg(\?v=\d+\.\d+\.\d+)?$/, | |
loader: "url?limit=10000&mimetype=image/svg+xml" | |
}, | |
{ | |
test: /\.(png|jpg|gif|svg)$/, | |
loader: 'url', | |
query: { | |
limit: 10000, | |
name: '[name].[ext]?[hash:7]' | |
} | |
} | |
] | |
}, | |
vue: { | |
loaders: { | |
js: 'babel!eslint' | |
} | |
}, | |
eslint: { | |
formatter: require('eslint-friendly-formatter') | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
hello, I want to know what's the meaning of these codes:
vue: {
loaders: {
js: 'babel!eslint'
}
}
and When I use webpack-validator, it can give me an error
[1] "vue" is not allowed.
please help me , thank you!
