Nuxt/test/fixtures/module/modules/basic/index.js

31 lines
689 B
JavaScript
Raw Normal View History

2017-05-14 22:33:31 +00:00
const path = require('path')
2018-03-15 08:24:29 +00:00
module.exports = function basicModule(options) {
2017-05-14 22:45:01 +00:00
// Add a plugin
this.addPlugin(path.resolve(__dirname, 'reverse.js'))
2017-05-14 22:33:31 +00:00
2018-02-07 11:58:48 +00:00
// Add a layout
this.addLayout(path.resolve(__dirname, 'layout.vue'))
2017-05-14 23:01:41 +00:00
// Extend build
2017-05-21 17:18:26 +00:00
this.extendBuild((config, { isClient, isServer }) => {
2017-05-14 23:01:41 +00:00
// Do nothing!
})
// Extend build again
2017-05-21 17:18:26 +00:00
this.extendBuild((config, { isClient, isServer }) => {
2017-05-14 23:01:41 +00:00
// Do nothing!
2017-08-22 22:10:43 +00:00
return config
2017-05-14 23:01:41 +00:00
})
// Extend routes
this.extendRoutes((routes, resolve) => {
// Do nothing!
2017-08-22 21:42:25 +00:00
return routes
2017-05-14 23:01:41 +00:00
})
2017-05-21 15:41:16 +00:00
// Require same module twice
2017-07-06 22:27:27 +00:00
this.requireModule('~/modules/empty/index.js')
this.requireModule('~/modules/empty/index.js')
2017-05-14 22:33:31 +00:00
}