Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gulp build issues #16

Open
seanlinsley opened this issue Mar 25, 2016 · 4 comments
Open

Gulp build issues #16

seanlinsley opened this issue Mar 25, 2016 · 4 comments

Comments

@seanlinsley
Copy link

Hi there, I'm trying to bundle pev into pghero: ankane/pghero#43.

Unfortunately, I haven't used Node apps very much 😅

When running npm run gulp -- build.prod, dist/dev is built. It looks like I could copy that directory and include it into pghero, except that the paths that index.html is looking up files from are incorrect. This is what it has:

<script src="/node_modules/es6-shim/es6-shim.min.js"></script>

While your demo page has script tags that load from the correct relative path:

<script src="lib/es6-shim.min.js"></script>

Any idea why that's happening?

Another issue: there are a large number of unminified JS files in dist/dev/lib. If I can figure out the necessary code to minify and concatenate them, would that be a change you're open to?

@seanlinsley
Copy link
Author

Looks like part of the problem is that config.ts sets ENV to dev even when running the build.prod task.

@seanlinsley
Copy link
Author

After manually changing those paths, I'm not able to boot the app by simply opening it in a browser, from the filesystem. I get this error:

system.src.js:1085 XMLHttpRequest cannot load file://[redacted]/dist/dev/bootstrap.js. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource.

@seanlinsley
Copy link
Author

python -m SimpleHTTPServer helps that, but I then had to copy tmp/bootstrap.js into dist/dev/lib, and add this config change:

System.config({"defaultJSExtensions":true,"paths":{"bootstrap":"/lib/bootstrap"}})

After that, the next file to fail is lib/components/app/app.js.

With all the resistance here, I've got to be doing something wrong. How do you build pev for production?

@AlexTatiyants
Copy link
Owner

Really sorry you’re having these issues. I tried (and failed) to get the prod build to work correctly. I finally ended up running build.prod and then manually editing index.html to point to “lib/*”. I’m certainly not proud of this, but it works.

On March 25, 2016 at 10:19:51 AM, Sean Linsley ([email protected]) wrote:

python -m SimpleHTTPServer helps that, but I then had copy tmp/bootstrap.js into dist/dev/lib, and add this config change:

System.config({"defaultJSExtensions":true,"paths":{"bootstrap":"/lib/bootstrap"}})
After that, the next file to fail is lib/components/app/app.js.

With all the resistance here, I've got to be doing something wrong. How do you build pev for production?


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants