-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Settings in config/webpack/test.js stopped working after of upgrade from 3.2 to 3.5 #1502
Comments
@guilleiguaran Is ProvidePlugin not working either? Have made an example repo and everything seems to work fine: https://github.com/gauravtiwari/webpacker-provide-plugin |
expose loader issue might be related to this: webpack-contrib/expose-loader#66 |
@gauravtiwari ProvidePlugin seems to be working normally, I'll check the expose-loader issue. |
@gauravtiwari I've cloned your app and added a
Passing
is this expected? should I set |
I'm seeing the same behavior as @guilleiguaran where If this is the intended behavior there should be a migration guide for those of us with custom environments ( |
Thanks, @guilleiguaran Sorry I am a bit confused 😄 Is this expose loader problem related to test environment?
Yes, those JS files are no longer necessary and you don't need to set a NODE_ENV anywhere. RAILS_ENV is now used to load settings from webpacker.yml and either development or production.js is used to compile the packs. Please see #1359 |
The problem is that after of upgrading the |
Oh yes, sorry so the new intended behaviour is we will use I have added some information here: https://github.com/rails/webpacker#custom-rails-environments but I guess it's not very clear. Happy to add it to Changelog as well. |
Thanks @gauravtiwari Just to add some context here's my const webpack = require('webpack')
const environment = require('./environment')
environment.plugins.set(
'Environment',
new webpack.EnvironmentPlugin({
SITE_URL: 'http://localhost:57712'
// SOMETHING_ELSE: 'GOOD'
})
)
module.exports = environment.toWebpackConfig() Since I was using it for environment variables it looks like I'll need to remove |
Thanks @seanabrahams Yes, please. We already have environment plugin added to webpack config: https://github.com/rails/webpacker/blob/master/package/environments/base.js#L27 so all you need to do is pass the env variable when running tests or binstubs.
|
Thanks @gauravtiwari One more follow up. I ran into the following issue on our continuous integration system after having removed
I then ran |
@seanabrahams Oh yes, it's because the latest changes are not yet published so |
It's very common to have more then development and production environments. For example the Is there any way to have |
Made a pre-release (with babel 7 support):
Also, has test.js included. |
I have expose loader set in
config/webpack/test.js
in a project with Webpacker 3.2:and I've modified the current configuration to match new conventions in 3.5 setting
NODE_ENV
and replacingenvironment.loaders.set
withenvironment.loaders.append
:But after of upgrading, this loader stopped working.
Everything else in the project work as expected and compiling success without problems but I can't get this working, does someone has any pointers about this?
My
config/webpack/environment.js
is this:The text was updated successfully, but these errors were encountered: