-
-
Notifications
You must be signed in to change notification settings - Fork 375
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
Migrate to Webpack 3.x #375
Conversation
- resolve all `env.src` & `env.cwd` logic within `runWebpack` - rename `helpers.src` —> `env.source` - replace references to `helpers` fn
- was a synchronous function anyway, don’t repeat
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@reznord Lol, it's not possible 😜 |
let entry = resolve(env.dest, './ssr-build/ssr-bundle.js'), | ||
url = params.url || '/'; | ||
let entry = resolve(env.dest, './ssr-build/ssr-bundle.js'); | ||
let url = params.url || '/'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is let
neccesary here? Can this be a const
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@developit prefers let
for most things. I broke the rule & used const
a few times to be emphatic.
} | ||
}); | ||
|
||
const pages = readJson(resolve(cwd, config.prerenderUrls || '')) || [{ url: '/' }]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should't this be using params.url
for the fallback?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For pages
? The params
is only within the ssr
function. I think the /
route is a safe default. Plus, it's just copied over from what was there already.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea maybe we should do it in a separate PR. Basically, the whole "subdirectory" stuff is something we should fix. But yea, let's keep it separate.
polyfills: resolve(__dirname, './polyfills') | ||
}, | ||
|
||
output: { | ||
path: env.dest, | ||
publicPath: '/', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use params.url here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Phenomenal. I will test this with a few of my apps to make sure it doesn't break anything.
I won't be able to test until later tonight if that's ok :) |
All good~! |
@lukeed every thing works pixel perfect 😄 |
Merging this. |
Drops the dependencies on
@webpack-blocks/*
which was explicitly requiringwebpack@2.x
and didn't look like an update was on the horizon.Includes
webpack.ModuleConcatenationPlugin
on client builds.Installs style-type loaders that
@webpack-blocks
installed for us previouslyMerges
webpack
configuration values viawebpack-merge
Thanks to @hassanbazzi who did most of the config rewrite in #150. This PR is largely based off his work 👏 This exists as a separate PR because some of Hassan's original changes were lost over time during merge-commits & this was easier (imo) than trying to go back and fix them.
Closes #367, #373, #150 (outdated)