2019-02-19 16:07:04 +00:00
|
|
|
export default function () {
|
|
|
|
// Add .coffee extension for store, middleware and more
|
2019-08-20 11:10:00 +00:00
|
|
|
this.nuxt.options.build.additionalExtensions.push('coffee')
|
2019-02-19 16:07:04 +00:00
|
|
|
// Extend build
|
|
|
|
const coffeeLoader = {
|
|
|
|
test: /\.coffee$/,
|
|
|
|
loader: 'coffee-loader'
|
|
|
|
}
|
|
|
|
this.extendBuild((config) => {
|
|
|
|
// Add CoffeeScruot loader
|
|
|
|
config.module.rules.push(coffeeLoader)
|
|
|
|
// Add .coffee extension in webpack resolve
|
2019-08-20 11:10:00 +00:00
|
|
|
if (!config.resolve.extensions.includes('.coffee')) {
|
2019-02-19 16:07:04 +00:00
|
|
|
config.resolve.extensions.push('.coffee')
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|