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

Migrate to Webpack 3.x #375

Merged
merged 19 commits into from
Sep 21, 2017
Merged

Migrate to Webpack 3.x #375

merged 19 commits into from
Sep 21, 2017

Conversation

lukeed
Copy link
Member

@lukeed lukeed commented Sep 18, 2017

  • Drops the dependencies on @webpack-blocks/* which was explicitly requiring webpack@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 previously

  • Merges webpack configuration values via webpack-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)

@lukeed lukeed added this to the 2.0 milestone Sep 18, 2017
Copy link
Member

@reznord reznord left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@lukeed this PR you should do a self-review lol (since you are the one who reviewed #150) :P

@lukeed
Copy link
Member Author

lukeed commented Sep 18, 2017

@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 || '/';
Copy link
Member

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?

Copy link
Member Author

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: '/' }];
Copy link
Member

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?

Copy link
Member Author

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.

Copy link
Member

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: '/',
Copy link
Member

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?

Copy link
Member

@hassanbazzi hassanbazzi left a 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.

@hassanbazzi
Copy link
Member

I won't be able to test until later tonight if that's ok :)

@lukeed
Copy link
Member Author

lukeed commented Sep 18, 2017

All good~!

@reznord
Copy link
Member

reznord commented Sep 21, 2017

@lukeed every thing works pixel perfect 😄

@reznord
Copy link
Member

reznord commented Sep 21, 2017

Merging this.

@reznord reznord merged commit ae50aad into master Sep 21, 2017
@lukeed lukeed deleted the webpack3 branch September 21, 2017 16:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Upgrade to Webpack 3
3 participants