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

33 lines
681 B
JavaScript
Raw Normal View History

2017-05-14 22:33:31 +00:00
const path = require('path')
2017-10-31 13:26:19 +00:00
module.exports = function basicModule(options, resolve) {
2017-05-14 22:45:01 +00:00
// Add vendor
this.addVendor('lodash')
2017-05-14 22:33:31 +00:00
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
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-21 15:41:16 +00:00
2017-05-14 22:45:01 +00:00
resolve()
2017-05-14 22:33:31 +00:00
}