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

marko-starter build static resources without JS/CSS/others #15

Open
ironsweet opened this issue Sep 3, 2017 · 4 comments
Open

marko-starter build static resources without JS/CSS/others #15

ironsweet opened this issue Sep 3, 2017 · 4 comments
Assignees
Labels

Comments

@ironsweet
Copy link

Steps to produce: (I have "yarn" and "serve" pre-installed.)

marko create test
cd test
yarn build
serve dist

Open the browser, expect to see the demo. But instead, only HTML without CSS/JS/images.

However, if I run marko-starter build without NODE_ENV=production, everything works just fine.

@roja
Copy link

roja commented Sep 18, 2017

any news on resolving this bug?

to reproduce follow:

marko create project
cd project
NODE_ENV=production marko-starter build

at this point the dist folder is in a reasonable state then:

NODE_ENV=production marko-starter build

this causes all js and css files to be removed leaving a broken build.

if the .cache folder is deleted and the command is run again i.e.

rm -rf .cache
NODE_ENV=production marko-starter build

then the dist folder once again contains a valid build

@patrick-steele-idem
Copy link
Contributor

I wouldn't expect JS and CSS files to be removed just by running NODE_ENV=production marko-starter build (there is no code to delete files in Lasso). Are you sure that that you are not deleting the Lasso output directory somehow?

Deleting .cache/ is probably a good workaround for now if you are seeing issues in your setup. We should probably invalidate the cache if the target dist directory for Lasso does not exist. In production, what we want to avoid is having to check files inside the dist directory to know if we need to do the build or not so we are completely relying on the cache. Currently, when in non-development mode, if if the cache says that the build has been done already then we assume that the previously generated files are there. We enter production mode if the NODE_ENV environment variable is set to anything other than `development.

We will be triaging issues this week and will investigate some more.

@ravihara
Copy link

ravihara commented Jan 1, 2018

I'm facing the same issue with respect to static build.

@adrfall
Copy link

adrfall commented Jan 16, 2019

I'm facing the same issue with respect to static build.

Same on windows and macos

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

No branches or pull requests

6 participants