Skip to content

fix(windows): fix component import paths on windows #46

New issue

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

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

Already on GitHub? # to your account

Conversation

DoubleU23
Copy link
Contributor

@DoubleU23 DoubleU23 commented Dec 7, 2019

fixes #43

information

the path module, doesn't care about the platform (see nodejs/node#12298)
and since you used explicit path.posix, relative paths didn't resolve correctly on windows.

using path.win32 would lead to the correct fs paths,
but we need the posix path to be written into the resulting component entry

to be discussed

there may be an more elegant way to convert the paths than using .replace()

changes

use path.win32 for windows platforms:
const path = require('path')[process.platform === 'win32' ? 'win32' : 'posix']

and transform component import paths with pathCrossEnv()
which replaces slashes to posix style if running on windows

system

tested on windows 10 in git bash
node v12.1.0
npm v6.13.0

@DoubleU23 DoubleU23 force-pushed the fix/componentImportPathsWindows branch from 318d0d7 to ce53092 Compare December 7, 2019 15:41
@DoubleU23 DoubleU23 changed the base branch from master to 2.0.0 December 7, 2019 15:46
@DoubleU23 DoubleU23 changed the base branch from 2.0.0 to master December 7, 2019 15:48
@DreadCube
Copy link

Nice! When we can expect the merge?

@saswatawork
Copy link

This is a major issue, this issue is kind of a blocker. Can we expect a quick merge please @wojtek-krysiak @chroventer

@DoubleU23
Copy link
Contributor Author

@wojtek-krysiak @chroventer
push to remember stale PR

@wojtek-krysiak wojtek-krysiak merged commit 5c143e8 into SoftwareBrothers:master Apr 28, 2020
vis97c added a commit to vis97c/better-docs that referenced this pull request Jul 25, 2020
This is a contribution to merge SoftwareBrothers#46 in which they fixed the react path but ignored the vue ones, also the cmd command is passed over cross-env package to make sure it works in any enviroment (linux/osx/windows)
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

@component: Bad character escape sequence error on windows 10
4 participants