-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
extract-text-webpack-plugin with webpack 2 #388
Comments
We are not using this plugin and I hope people use Webpack2 with Storybook without any issues. |
@arunoda I know storybook is not using this plugin but my project does. Therefore storybook breaks when I am trying to have it compile my styles from my project. This is important because my external style file must exist for my story's to display properly. Simply removing the plugin from storybook #369 does not solve the problem if I need the plugin for my project. If your not going to fix it what would your recommendation be? |
That's pretty weird. We don't automatically load it. |
Anyway, we need to find the root cause for this issue. |
Is there any updates on this. We are getting:
with Any fix available? |
I am also running into exactly this while upgrading to Webpack 2.x. I'm running into what seem to be the same errors @jhicken mentions above. Have you come across any solution to this? As far as I can tell, this is related to the @arunoda can you confirm if this is expected?
We've been successfully using Storybook + Webpack v1.x following the "Simple Mode" to enable Our Webpack 2.x upgrade has gone smoothly according to Webpack's v1 to v2 Guide with the exception of our Storybook now being out of commission until we figure this out. Relevant versions: // package.json
{
// ...
devDependencies: {
// ...
"@kadira/storybook": "^2.5.2",
"extract-text-webpack-plugin": "2.0.0-beta.4",
"webpack": "2.2.0-rc.3",
}
} In the meantime, I'll continue exploring and see if I can come up with a solution or more details. |
I did get this resolved for my project. The solution ended up being to not use Here is my full const {
styleLoader,
fontLoader,
} = require('../webpack/pieces');
/**
* See: https://getstorybook.io/docs/react-storybook/configurations/custom-webpack-config
*/
module.exports = function(storybookConfig) {
// Set an absolute public path. Required for reasons of JS-imported styles
// See: http://stackoverflow.com/questions/34133808/webpack-ots-parsing-error-loading-fonts/34133809#34133809
Object.assign(storybookConfig.output, {
publicPath: 'http://localhost:6006/',
});
// Enable JS-imported styles/fonts
storybookConfig.module.loaders.push(
styleLoader,
fontLoader
);
return storybookConfig;
}; For more context, I recommend reading these related comments I left throughout my journey. Related to upgrading Webpack 2.x and it playing nicely w/ Storybook. |
references #637 |
So this is for subscribers on this issue: Here's my progress: I've done all the work to support webpack 2 on here. I'll keep you all updated on the progress! Thank you all! So don't feel bad or like this isn't going to happen, because it's going to happen SOON! |
This issue has been fixed in |
So I am using webpack 2.1.0-beta.21 and storybook 2.3.0 and extract-text-webpack-plugin 2.0.0-beta.3. In full control mode. When I have new ExtractTextPlugin('styles.css') defined things explode.
/node_modules/extract-text-webpack-plugin/index.js:245
var shouldExtract = !!(options.allChunks || chunk.isInitial());
if i use extract-text-webpack-plugin 1.0.1 I get this.
/node_modules/webpack/lib/Chunk.js:37
throw new Error("Chunk.entry was removed. Use hasRuntime()");
This seems to only be a problem with storybook. It work just fine when running my regular webpack build.
The text was updated successfully, but these errors were encountered: