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

Not working for dynamically imported css? #19

Open
arichter83 opened this issue Jul 10, 2019 · 2 comments
Open

Not working for dynamically imported css? #19

arichter83 opened this issue Jul 10, 2019 · 2 comments

Comments

@arichter83
Copy link

arichter83 commented Jul 10, 2019

I tried this package, but it did not work for me. I created something to reproduce:

git clone -b using-MiniCssExtractPlugin https://github.com/arichter83/meteor-react-typescript-nightwatch.git
meteor npm install
meteor 

In Info.tsx there is a dynamic import:

import(/* webpackChunkName: "info" */ '../../client/info.css')

This will generate a info.js and a info.css:

I20190710-18:56:58.603(2)?     info.21e44ad1ca43ac862441.js  392 bytes    info  [emitted]  info
I20190710-18:56:58.603(2)?                         info.css   30 bytes    info  [emitted]  info

And the info.js will still be loaded in the client, even though I think it is obsolete:

(window["webpackJsonp"] = window["webpackJsonp"] || []).push([["info"],{

/***/ "./client/info.css":
/*!*************************!*\
  !*** ./client/info.css ***!
  \*************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {

eval("// extracted by mini-css-extract-plugin\n\n//# sourceURL=webpack:///./client/info.css?");

/***/ })

}]);

And in my webpack.config.js I use the plugin:

new FixStyleOnlyEntriesPlugin(),

Where is my mistake? Thank you for your help.

PS: I also added a StackOverflow question https://stackoverflow.com/questions/56937912/webpack-dynamic-import-scss-generates-tiny-js-files

@yaroslavvertukhov
Copy link

I have the same problem

@yaroslavvertukhov
Copy link

@arichter83 Did you find a solution?

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

No branches or pull requests

2 participants