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
webpack.js regex problems (linux and windows) #8
Comments
In the react-hot-boilerplate I saw there might be an even better to this, by specifying the module: {
loaders: [{
test: /\.jsx?$/,
loader: 'babel-loader',
include: path.resolve(__dirname, '../src')
}]
} This bring sthe test in line with what you will find in most examples, and you don't have to worry about having to start excluding things like bower components down the line. |
good issue |
5 years! 5 years have passed since ... |
The real problem is not to define a delimiter. The real problem is to apply the capture group after RegEx is running, like this:
Windows will not use "/" (from [1]) in the path for new file. |
The
test
line inwebpack.js
is incorrect for all systems and has 2 issues and 1 possible source of problems for users building on the tutorial.Please note the 2nd
.
is not escaped, it should read/src\/.+\.js$/
. This was undetected because the regex still works even if it does not match properly.However real problems begin on windows, the
\/
slash doesn't work, producing aUnexpected reserved word
You may need an appropriate loader to handle this file type.
error.This can be fixed by accepting either slash, with the regex
/src(\/|\\).+\.js$/
.Finally, a specific user may expand and convert the
client.js
into aclient.jsx
and change their entry line, but find things stop working. Or they may use this as a learning project and copy it to another project where their entry is a jsx. You could help them out by giving them a reg ex that handles this case, in the form of:/src(\\|\/).+\.jsx?$/
which takesjs
orjsx
.I imagine this improvement can be made your flux tutorial as well.
The text was updated successfully, but these errors were encountered: