@cherif_b and i am working on a multipage-app.
we want to make a workflow for using stealjs + steal-tools and maybe with PHP at the backend.
i jumped into several issues that came with the build.
the repro i am working on is:
it is pretty easy but the issues are mass.
in develop
mode all is working correctly. @justinbmeyer and i have a meetup https://www.youtube.com/watch?v=3Xx4BeDKoFg
where we make some changes on steal-tools so that the build was working.
but after that it becomes apparent that there are other issues out there.
i am using:
- steal-tools@0.13.3
- npm 3.3.12
- node 5.5.0
- using the donejs vagrant box
to repoduce the issues please clone the repo and start http-server
-
make a build.
bundleSteal
is true. thedist/bundles/dev1/main.js
is without steal. openhttp://localhost:8080/prod_1.html
Error:Uncaught ReferenceError: define is not defined
-
open
http://localhost:8080/prod_2.html
.main
is set as the same in dev_2.html.buildit
is the app-name
Error:http://localhost:8080/dist/bundles/buildit/dev2/main.js 404 (Not Found)
-
open
http://localhost:8080/prod_3.html
. the dev2 bundle is funnily enough with steal. so dist file is loaded directly. got two errors
Error:GET http://localhost:8080/dist/bundles/dev2/dist/bundles/dev2/main.css 404 (Not Found)
Error:Potentially unhandled rejection [5] Error loading "buildit@1.0.0#button-comp/button-comp.less!$less" at file:/home/vagrant/buildit/src/button-comp/button-comp.less Error loading "buildit@1.0.0#button-comp/button-comp.less!$less" from "buildit@1.0.0#dev2/main" at file:/home/vagrant/buildit/src/dev2/main.js Error loading "bundles/dev2/main.css!$css" at http://localhost:8080/dist/bundles/dev2/dist/bundles/dev2/main.css Not Found: http://localhost:8080/dist/bundles/dev2/dist/bundles/dev2/main.css (WARNING: non-Error used)
-
open
src/button-comp/button-comp.js
. changeimport './button-comp.less!';
toimport './button-comp.scss!';
. make a build!
got a build error:
Potentially unhandled rejection [7] Error: Error loading "buildit@1.0.0#button-comp/button-comp.scss!steal-sass@1.0.1#main" at <unknown> Error loading "buildit@1.0.0#button-comp/button-comp.scss!steal-sass@1.0.1#main" from "buildit@1.0.0#dev2/main" at file:/home/vagrant/buildit/src/dev2/main.js Error loading "nodesass" at file:/home/vagrant/buildit/nodesass.js Error loading "nodesass" from "steal-sass@1.0.1#main" at file:/home/vagrant/buildit/node_modules/steal-sass/main.js ENOENT: no such file or directory, open '/home/vagrant/buildit/nodesass.js' at Error (native)
-
open the
build.js
and change to
var stealTools = require("steal-tools");
var buildPromise = stealTools.build({
main: "buildit/dev1/main",
config: __dirname + "/package.json!npm"
},{
bundleSteal: true,
minify: true,
debug: true,
quiet: false,
bundleDepth: 3,
mainDepth: 3
});
so there is no multi build anymore. make a build. got 2 errors:
Error 1:
GET http://localhost:8080/dist/bundles/dev1/dist/bundles/dev1/main.css 404 (Not Found)
the same as in 3)
Error 2:
Potentially unhandled rejection [5] Error loading "css/style.css!$css" at http://localhost:8080/dist/bundles/dev1/css/style.css Error loading "css/style.css!$css" from "buildit@1.0.0#dev1/main" at file:/home/vagrant/buildit/src/dev1/main.js Error loading "bundles/dev1/main.css!$css" at http://localhost:8080/dist/bundles/dev1/dist/bundles/dev1/main.css Not Found: http://localhost:8080/dist/bundles/dev1/dist/bundles/dev1/main.css (WARNING: non-Error used)
notice, that we import import 'css/style.css!';
in dev1/main.js and the css file is not located under the dist folder! but in css/styles
under the root folder
Last Issue
- Notice, that we have the module
buildit/module1/module
we import that module indev1/main
and inbutton-comp
. why is that module not split into a separate bundle? it is used multiple times?