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

Fix static folder destination on Windows and clean up its implementation #118

Merged
merged 1 commit into from
Jun 16, 2020

Conversation

j-maas
Copy link
Contributor

@j-maas j-maas commented Jun 12, 2020

On Windows, a file in static/file.txt was put into dist/static/file.txt instead of dist/file.txt.

This was because we cut off everything before the first "/" in the target path string, but Windows separates folders with "".

Instead, we can use the somewhat hidden context feature from the CopyPlugin to get rid of the static/ prefix. See https://webpack.js.org/plugins/copy-webpack-plugin/#from-is-a-glob

On Windows, a file in static/file.txt was put into dist/static/file.txt instead of dist/file.txt.

This was because we cut off everything before the first "/" in the target path string, but Windows separates folders with "\".

Instead, we can use the somewhat hidden context feature from the CopyPlugin to get rid of the static/ prefix. See https://webpack.js.org/plugins/copy-webpack-plugin/#from-is-a-glob
@dillonkearns dillonkearns merged commit 3e1bd85 into dillonkearns:master Jun 16, 2020
@j-maas j-maas deleted the fix-static-destination branch June 16, 2020 15:35
@dillonkearns
Copy link
Owner

Thank you so much for the fix @y0hy0h! I confirmed that it's still working as expected on Mac.

Just released this with NPM version 1.4.1: https://github.com/dillonkearns/elm-pages/blob/master/CHANGELOG-NPM.md#141---2020-06-16.

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

Successfully merging this pull request may close these issues.

2 participants