This repository has been archived by the owner on Sep 11, 2018. It is now read-only.
Fix Webpack build for published packages, puny refactor #1289
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
First up, thanks for an excellent starter-kit, using this in prod for some time now, keep up the great work!
I've ran into an issue with using packages based on the starter kit.
If you're basing a project upon the starter kit and you publish it to, say, a privately hosted NPM registry, compilation may fail if the path up to the project,
say
/home/proj/starter-kit
,includes
node_modules
, e.g./home/proj/node_modules--this-breaks-it/starter-kit
.This is the case with an NPM registry, where running an
npm i my-project-based-on-this-starter-kit
automatically creates a folder named, how else,node_modules
and installs the package therein. Thus, the package, whennpm
-installed under a path such as<wherever>/node_modules(.*?)/my-project-based-on-this-starter-kit
cannot be compiled using Webpack.It basically does not include the much needed Webpack
babel-loader
which should compile JSX to parseable/readable JS, yielding a stack-trace such asNarrowing it down to this was, of course, painful. A
compile
would work on the git checkout and fail on the deployed/installed package. An issue with CreateReactApp finally got me on the right path.Popular opinion from Webpack's creator also semi-demonizes the use of
exclude
. I wanted to tryinclude: project.basePath
but that did not work. /cc @davezuko Any ideas here?If going forward with the
include
fix, one would have to expand the readme and mention the fact that onlyappDir
sources are compiled and one has to explicitly specify other paths if one needs to compile other non-src
sources.Here's a quick repro term session from my env (Win32):
Or try this in a term:
P.S.: Sorry for missing the "No capitalization on first letter" on the commit/contributing styleguide and mis-labeling the refactor-ish commit.
Meta – Related issues, which helped in narrowing the root cause, would be: