My English skills are not very good, so I apologize for using GPT for translation!
I have a requirement that needs to be addressed, as follows: Bundle a project into two folders, one named "base," and the other named "extra." Base folder: can run independently and, if necessary, incorporate the contents of the "extra" folder, as an example, similar to the standard version of a project. Extra folder: does not need to run independently and requires dependence on the "base" to function, similar to additional DLC in a game.
The structure is as follows.
base
├── index.html
├── *.js
├── *.css
│
extra
├── *.js
├── *.css
I would like to ask if webpack can fulfill my requirements. If there is any code or similar issues, please let me know. Thank you for your assistance!
vue.config.js
module.exports = {
// publicPath: process.env.NODE_ENV === 'production' ? '/cli-test/' : '/',
publicPath: '/',
pages: {
main: {
entry: 'src/main.ts', // 主入口
template: 'public/index.html',
},
extra: {
entry: 'src/extra.ts', // 額外入口
template: 'public/index.html',
}
}
}