File tree Expand file tree Collapse file tree 35 files changed +988
-191
lines changed
Expand file tree Collapse file tree 35 files changed +988
-191
lines changed Original file line number Diff line number Diff line change 22( self [ "webpackChunk" ] = self [ "webpackChunk" ] || [ ] ) . push ( [ [ "entry1" ] , {
33"./entryA.js" : ( function ( __unused_webpack_module , __webpack_exports__ , __webpack_require__ ) {
44__webpack_require__ . r ( __webpack_exports__ ) ;
5- /* ESM import */ var _styleA_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__ ( "./styleA.css" ) ;
5+ /* import */ var _styleA_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__ ( "./styleA.css" ) ;
66
77
88
99} ) ,
1010"./entryB.js" : ( function ( __unused_webpack_module , __webpack_exports__ , __webpack_require__ ) {
1111__webpack_require__ . r ( __webpack_exports__ ) ;
12- /* ESM import */ var _styleB_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__ ( "./styleB.css" ) ;
12+ /* import */ var _styleB_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__ ( "./styleB.css" ) ;
1313
1414
1515
Original file line number Diff line number Diff line change 22( self [ "webpackChunk" ] = self [ "webpackChunk" ] || [ ] ) . push ( [ [ "entry1" ] , {
33"./entryA.js" : ( function ( __unused_webpack_module , __webpack_exports__ , __webpack_require__ ) {
44__webpack_require__ . r ( __webpack_exports__ ) ;
5- /* ESM import */ var _styleA_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__ ( "./styleA.css" ) ;
5+ /* import */ var _styleA_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__ ( "./styleA.css" ) ;
66
77
88
Original file line number Diff line number Diff line change @@ -2,9 +2,9 @@ const fs = require("fs");
22const path = require ( "path" ) ;
33module . exports = function ( outputDirectory , _stats ) {
44 const mainContent = fs . readFileSync ( path . resolve ( outputDirectory , "main.js" ) , "utf8" ) ;
5- expect ( mainContent ) . toContain ( `if (oldTag) {
6- oldTag.parentNode.insertBefore(linkTag, oldTag.nextSibling);
7- } else {
8- document.head.appendChild(linkTag);
9- }` ) ;
5+ expect ( mainContent ) . toContain ( `if (oldTag) {` ) ;
6+ expect ( mainContent ) . toContain ( ` oldTag.parentNode.insertBefore(linkTag, oldTag.nextSibling);` ) ;
7+ expect ( mainContent ) . toContain ( ` } else {` ) ;
8+ expect ( mainContent ) . toContain ( ` document.head.appendChild(linkTag);` ) ;
9+ expect ( mainContent ) . toContain ( ` }`) ;
1010} ;
Original file line number Diff line number Diff line change 1+ .a {
2+ color : red;
3+ }
Original file line number Diff line number Diff line change 1+ .a {
2+ color : red;
3+ }
4+
Original file line number Diff line number Diff line change 1+ import "./a.css" ;
2+
3+ import ( /* webpackPrefetch: true */ "./b" ) ;
Original file line number Diff line number Diff line change 1+ const { CssExtractRspackPlugin, HotModuleReplacementPlugin } = require ( "@rspack/core" ) ;
2+
3+ module . exports = {
4+ entry : "./index.js" ,
5+ module : {
6+ rules : [
7+ {
8+ test : / \. c s s $ / ,
9+ use : [ CssExtractRspackPlugin . loader , "css-loader" ] ,
10+ } ,
11+ ] ,
12+ } ,
13+ plugins : [
14+ new CssExtractRspackPlugin ( {
15+ filename : "[name].css" ,
16+ } ) ,
17+ new HotModuleReplacementPlugin ( ) ,
18+ ] ,
19+ } ;
Original file line number Diff line number Diff line change 1+ .a {
2+ color : red;
3+ }
Original file line number Diff line number Diff line change 1+ import ( /* webpackPrefetch: true, webpackChunkName: "b1" */ "./b1.css" ) ;
2+ import ( /* webpackPreload: true, webpackChunkName: "b2" */ "./b2.css" ) ;
3+ import ( /* webpackPrefetch: true, webpackChunkName: "b3" */ "./b3" ) ;
You can’t perform that action at this time.
0 commit comments