-
-
Notifications
You must be signed in to change notification settings - Fork 10.7k
Update website to Webpack v3 #5725
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
Conversation
Can't we set up a loader rule scoped to just that path? I also wonder if we can get rid of some of the relative pathing all over the place by providing a base path at the repo root. That gets tedious after a while. |
I was staring at that config for a bit trying to figure out why the website is importing the same file twice. load: require('bundle?lazy!babel!../examples/Basic'),
loadSource: require('bundle?lazy!!prismjs?lang=jsx!../examples/Basic.js')
|
load: require('bundle?lazy!babel!../examples/Basic'), | ||
loadSource: require('bundle?lazy!!prismjs?lang=jsx!../examples/Basic.js') | ||
load: require('../examples/Basic?bundle'), | ||
loadSource: require('../examples/Basic.js?prismjs') |
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.
This configuration has been moved to the Webpack config. Because we are loading one file two different ways, we need to use a resource query to differentiate between when to read it as JavaScript and when to read it as a string to markup.
const Prism = require('prismjs'); | ||
|
||
module.exports = function loader(content) { | ||
const query = this.query |
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.
Moving the configuration to the Webpack config broke the prismjs-loader
. I will probably look into making a PR for this (I think it is a simple fix, but I'll have to run some tests), but I included the updated source here so that we don't have to wait for that to happen.
website/webpack/prismjs-loader.js
Outdated
@@ -0,0 +1,26 @@ | |||
// modified version of https://github.com/valor-software/prismjs-loader | |||
'use strict'; | |||
const Prism = require('prismjs'); |
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.
I don't see a prismjs dep. Even if it's implicitly available, I'd rather it be an explicit dependency.
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.
Come to think of it, my local build probably only worked because prismjs
was still installed.
We should be able to add a |
Is this g2g? |
I want to say yes, but I'll need to take another look at it. |
f5e81ae
to
31a65e2
Compare
Alright, everything should be good. I just updated the various Webpack deps to their I never heard a peep on my PR for updating the |
I'd throw the license in as a comment at the top. |
I think this is all good to go, right? |
Yes |
Make it so. |
* Update website to Webpack v3 * Move bundle loaders to Webpack config * Add prismjs devDep * +resolve.modules, -dot-dots * Latest deps * Add prismjs-loader license
I'd also like to get rid of those inline loaders, but that wasn't as straightforward, so I skipped it for the time being.