One of the things I like about Webpack is that I had the able to define an entry as an array of files. Typically these are names of dependencies & not direct file paths.
Then, when importing bits from this array-entry, the useful pieces (after code shaking) are placed in that new, generated file.
This is particularly (and commonly) useful for when there's a single app entry & a declaration of shared vendor scripts. In such case, Splittable AFAIK won't generated a shared _base.js.
module.exports = {
entry: {
app: './src/app.js',
vendor: [
'vue',
'vue-router',
'firebase/database',
'...'
]
}
// app.js (simple)
import Vue from 'vue'
import Router from 'vue-router'
import 'firebase/database'
Final output should contain all the application script in app.js and all useful chunks within vendor.js.
This could probably be achieved already, but it seems pretty silly & I think there'd be some unnecessary code to string together the vendor file to _base:
// app.js
import Vue from 'vue'
import Router from 'vue-router'
import 'firebase/database'
import { item } from 'fake-dep'
// now do custom stuff
// vendor.js
// just redeclare all application imports
import Vue from 'vue'
import Router from 'vue-router'
import 'firebase/database'
import { item } from 'fake-dep'
One of the things I like about Webpack is that I had the able to define an entry as an array of files. Typically these are names of dependencies & not direct file paths.
Then, when importing bits from this array-entry, the useful pieces (after code shaking) are placed in that new, generated file.
This is particularly (and commonly) useful for when there's a single
appentry & a declaration of sharedvendorscripts. In such case, Splittable AFAIK won't generated a shared_base.js.Final output should contain all the application script in
app.jsand all useful chunks withinvendor.js.This could probably be achieved already, but it seems pretty silly & I think there'd be some unnecessary code to string together the
vendorfile to_base: