Skip to content

Instantly share code, notes, and snippets.

@matthieu-D
Created January 24, 2018 17:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matthieu-D/854a381f940c01ece25ca999bb529ef3 to your computer and use it in GitHub Desktop.
Save matthieu-D/854a381f940c01ece25ca999bb529ef3 to your computer and use it in GitHub Desktop.
const webpackConfig = require('./node_modules/@ionic/app-scripts/config/webpack.config');
const vueAlias = {
extensions: ['.ts', '.js', '.vue', '.json'],
alias: {
'vue$': 'vue/dist/vue.esm.js'
}
};
const vueRule = {
test: /\.vue$/,
loader: 'vue-loader',
options: {
// Since sass-loader (weirdly) has SCSS as its default parse mode, we map the
// "scss" and "sass" values for the lang attribute to the right configs here.
// other preprocessors should work out of the box, no loader config like this
// necessary.
'scss': [
'vue-style-loader', 'css-loader', 'sass-loader'
],
'sass': ['vue-style-loader', 'css-loader', 'sass-loader?indentedSyntax']
}
// other vue-loader options go here
};
webpackConfig.dev.module.loaders.push(vueRule)
webpackConfig.dev.resolve = Object.assign(webpackConfig.dev.resolve, vueAlias)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment