2018-03-16 16:12:06 +00:00
|
|
|
export default function () {
|
2018-01-05 08:43:35 +00:00
|
|
|
// Add .coffee extension for store, middleware and more
|
|
|
|
this.nuxt.options.extensions.push('coffee')
|
|
|
|
// Extend build
|
|
|
|
const coffeeLoader = {
|
|
|
|
test: /\.coffee$/,
|
|
|
|
loader: 'coffee-loader'
|
|
|
|
}
|
2018-08-06 00:12:44 +00:00
|
|
|
this.extendBuild((config) => {
|
2018-01-05 08:43:35 +00:00
|
|
|
// Add CoffeeScruot loader
|
|
|
|
config.module.rules.push(coffeeLoader)
|
|
|
|
// Add .coffee extension in webpack resolve
|
2019-07-10 10:45:49 +00:00
|
|
|
if (!config.resolve.extensions.includes('.coffee')) {
|
2018-01-05 08:43:35 +00:00
|
|
|
config.resolve.extensions.push('.coffee')
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|