Open arichter83 opened 5 years ago
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
I have the same problem
@arichter83 Did you find a solution?
I tried this package, but it did not work for me. I created something to reproduce:
In Info.tsx there is a dynamic import:
import(/* webpackChunkName: "info" */ '../../client/info.css')
This will generate a info.js and a info.css:
And the info.js will still be loaded in the client, even though I think it is obsolete:
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