Closed icandeveloper closed 7 years ago
See the following snippet on how to generate multiple JS files -- they'll end up in your dist
with the appropriate name:
javascripts: {
entry: {
// files paths are relative to
// javascripts.dest in path-config.json
app: ["./app.js"],
navigation-only: ["./navigation-only.js"],
another-js-file: ["./js1.js", "./js2.js"]
},
// This tells webpack middleware where to
// serve js files from in development:
publicPath: "/assets/javascripts"
},
Thanks @kennethwyu, that worked. Just had to remove the "-" in the name.
I would like to build two separate javascript files, one called app.js that will have my websites general JS and another called navigation-only.js that will be used in a separate standalone part of the application.
In my task-config.js file I have updated the config to have both app and navigation-only but this is still compiling a single app.js. Even when I remove app.js it compiles it as app.js instead of navigation. The navigation code is included in that file though. How would I separate them into different files for inclusion?
Thanks