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

Paths on Windows #1

Closed
dothem1337 opened this issue Jun 15, 2018 · 5 comments
Closed

Paths on Windows #1

dothem1337 opened this issue Jun 15, 2018 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@dothem1337
Copy link

dothem1337 commented Jun 15, 2018

hey, great lib!

But i have problems on windows system with the build process. Windows does not like ./ paths. Can you maybe fix this? :)

If not, I can build my own lib for windows :)

Thank you!

@tehpsalmist
Copy link
Owner

Hey dothem1337, sorry I didn't see this issue earlier in the weekend. If you've already created a solution, I'd love to review a PR. Otherwise, if you can give me a couple days to figure it out, I might be able to resolve this one myself. I really only have experience with linux/Mac, so any tips or experience you can share would also be helpful to get this feature/fix out quickly. Thanks!

@tehpsalmist
Copy link
Owner

Just doing some cursory reading, and now I'm curious where specifically you are getting errors?

@dothem1337
Copy link
Author

dothem1337 commented Jun 18, 2018

hey @tehpsalmist

The problem is on build, so on npm start or something else, it will fail, because it cant not resolve the ./node_modules/.bin path.

Windows cant handle ./ paths. I fixed it with the follwowing: path.resolve
The build.js shoud look like:

const exec = require('child_process').exec
const fs = require('fs')
const path = require('path')

module.exports = () => {
  const ngTwFile = path.resolve(process.cwd(), 'ng-tailwind.js')
  if (fs.existsSync(ngTwFile)) {
    const config = require(ngTwFile)
    exec(
      path.resolve('./node_modules/.bin') + `/tailwind build ${config.sourceCSS} -c ${config.configJS} -o ${config.outputCSS}`,
      err => err ? console.error(err) : console.info('Successful Build!')
    )
  } else {
    console.error('No ng-tailwind.js file exists.\nPlease run `ng-tailwindcss configure`.\nRun `ng-tailwindcss --help` for assistance,\nor view the Readme at\nhttps://github.com/tehpsalmist/ng-tailwindcss')
  }
}

But now, I have another problem with the watch. It doesnt watch my files. And I did not found out why. The changes to the files take no effect and will not be rebuilded.

@tehpsalmist
Copy link
Owner

Ok, it sounds like Windows is going to have many issues with this path problem. I'm not sure how soon I'll be able to roll out a solution, or how well tested it can be, since my only windows machine is in parts right now. I'll figure something out. In the meantime, if you want to submit a PR, that would be helpful too. Thanks for all the feedback!

@tehpsalmist
Copy link
Owner

@dothem1337 , I think I have some solutions in the works here. Stay tuned for a release, and if you can reproduce the watch error, and let me know what your ng-tailwind.js file looks like when you run watch, that would be helpful too. If your config doesn't match your actual file structure, that would obviously be a problem. Thanks again for the feedback, I wouldn't have foreseen this issue otherwise.

@tehpsalmist tehpsalmist added the bug Something isn't working label Jun 20, 2018
@tehpsalmist tehpsalmist self-assigned this Jun 20, 2018
@tehpsalmist tehpsalmist added this to the Windows Compatibility milestone Jun 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants