Skip to content

Instantly share code, notes, and snippets.

@ckhrysze
Created August 31, 2017 16:12
Show Gist options
  • Save ckhrysze/b4bda3bb5e23c91fd1b737cb6322656f to your computer and use it in GitHub Desktop.
Save ckhrysze/b4bda3bb5e23c91fd1b737cb6322656f to your computer and use it in GitHub Desktop.
var path = require('path')
var webpack = require('webpack')
var ExtractTextPlugin = require('extract-text-webpack-plugin');
module.exports = {
entry: ['./js/dashboard.js', './styles/main.scss'],
output: {
path: path.resolve(__dirname, '../priv/static/'),
publicPath: '/js/',
filename: 'js/dashboard.js'
},
module: {
rules: [
{
test: /\.vue$/,
use: {
loader: 'vue-loader',
options: {
loaders: {
scss: [
'vue-style-loader',
'css-loader',
'sass-loader',
{
loader: 'sass-resources-loader',
options: {
resources: path.resolve(__dirname, 'styles/variables.scss')
}
}
]
}
}
}
},
{
test: /\.(png|jpg|gif|svg)$/,
loader: 'file-loader',
options: { name: '[name].[ext]?[hash]' }
},
{
test: /\.scss$/,
loader: ExtractTextPlugin.extract(['css-loader', 'sass-loader'])
}
]
},
plugins: [
new ExtractTextPlugin({
filename: 'css/main.css',
allChunks: true
})
],
resolve: {
alias: {
'vue$': 'vue/dist/vue.esm.js'
}
},
devtool: '#eval-source-map'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment