Closed
Description
There are a lot of cases where we need to modify the main.js
file (or main.ts
). For example importing modules, adding options to the instance and such.
Proposed API:
// Generator
api.extendScript('./src/main', file => {
// Import a file
file.import('{ apolloProvider }', './vue-apollo')
// Direct import
file.import('./style.css')
// Add an option to the instance
file.extendOptions({
provide: 'apolloProvider.provide()',
})
})