Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var vue = require('vue-loader')
module.exports = {
entry: "./src/main.js",
output: {
path: "./build",
filename: "build.js"
},
module: {
loaders: [
{
test: /\.vue$/,
loader: vue.withLoaders({
// apply babel transform to all javascript
// inside *.vue files.
js: 'babel?optional[]=runtime'
})
}
]
},
devtool: 'source-map'
}
exclude: [
],
// preprocess matching files before serving them to the browser
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
preprocessors: {
"./test/**/*.js": ['webpack', 'sourcemap'],
"./demo/**/*.vue": ['webpack', 'sourcemap'],
"./src/**/*.js": ['webpack', 'sourcemap', 'coverage']
},
webpack: {
devtool: 'inline-source-map',
module: {
loaders: [
{ test: /\.vue$/, loader: VueLoader.withLoaders({html: "raw"}) } // use raw-loader to process HTML
],
postLoaders: [{
test: /\.js$/,
exclude: /test|node_modules|lib/,
loader: 'istanbul-instrumenter'
}]
}
},
webpackMiddleware: {
noInfo: true
},
// test results reporter to use
// possible values: 'dots', 'progress'
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
entry: {
app: ['webpack/hot/dev-server', './src/index.js']
},
output: {
path: __dirname,
publicPath: '/dist/',
filename: 'app.js'
},
resolve: {
extensions: ['', '.js', '.vue']
},
module: {
loaders: [
{
test: /\.vue$/,
loader: vue.withLoaders({
js: 'babel?optional[]=runtime'
})
}, {
test: /\.js$/,
loader: 'babel-loader?blacklist[]=react'
}
]
}
}
var vue = require('vue-loader')
module.exports = {
entry: {
app: ['webpack/hot/dev-server', './src/main.js']
},
output: {
path: './build',
filename: 'bundle.js'
},
module: {
loaders: [
{ test: /\.vue$/, loader: vue.withLoaders({
js: 'babel?optional[]=runtime'
}) },
{ test: /\.js$/, exclude: /node_modules/, loader: 'babel?optional[]=runtime'}
]
},
devtool: 'source-map',
devServer: {
contentBase: './build',
historyApiFallback: true
}
}
function webpackConfig(opt) {
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var scssLoader = ExtractTextPlugin.extract('style','css!sass?outputStyle=expanded&includePaths[]=' + bourbon);
var config = {
output: {
publicPath: paths.context,
filename: "monitor.bundle.js"
},
plugins: [ new ExtractTextPlugin("monitor.css") ],
module: {
loaders: [
{test: /\.vue$/, loader: vue.withLoaders({scss: scssLoader})},
{test: /\.scss$/, exclude: /node_modules/, loader: scssLoader},
{
test: /\.(jpe?g|png|gif|svg)$/i,
loaders: [
'file?name=[name].[ext]',
'image-webpack?{progressive:true, optimizationLevel: 7, interlaced: false, pngquant:{quality: "65-90", speed: 4}}'
]
}
]
},
devtool: 'source-map',
};
if (!opt) return config;
for (var i in opt) {
config[i] = opt[i]
}