File tree Expand file tree Collapse file tree 4 files changed +45
-0
lines changed
test/configCases/target/universal-public-path Expand file tree Collapse file tree 4 files changed +45
-0
lines changed Original file line number Diff line number Diff line change 1+ import img from "./image.png" ;
2+
3+ it ( "should resolve public path automatically in universal target" , ( ) => {
4+ expect ( img ) . toMatch ( / ^ ( h t t p s ? | f i l e ) : \/ \/ / ) ;
5+ expect ( img ) . toMatch ( / [ a - f 0 - 9 ] + \. p n g $ / ) ;
6+ expect ( img . startsWith ( __webpack_public_path__ ) ) . toBe ( true ) ;
7+ } ) ;
8+
9+ it ( "should have correct __webpack_public_path__" , ( ) => {
10+ expect ( __webpack_public_path__ ) . toMatch ( / ^ ( h t t p s ? | f i l e ) : \/ \/ / ) ;
11+ } ) ;
Original file line number Diff line number Diff line change 1+ "use strict" ;
2+
3+ module . exports = {
4+ findBundle ( i , options ) {
5+ return [ "main.mjs" ] ;
6+ }
7+ } ;
Original file line number Diff line number Diff line change 1+ "use strict" ;
2+
3+ /** @type {import("../../../../").Configuration[] } */
4+ module . exports = [
5+ {
6+ name : "universal-esm" ,
7+ target : [ "web" , "node" ] ,
8+ mode : "development" ,
9+ devtool : false ,
10+ output : {
11+ publicPath : "auto" ,
12+ module : true ,
13+ filename : "[name].mjs"
14+ } ,
15+ experiments : {
16+ outputModule : true
17+ } ,
18+ module : {
19+ rules : [
20+ {
21+ test : / \. p n g $ / ,
22+ type : "asset/resource"
23+ }
24+ ]
25+ }
26+ }
27+ ] ;
You can’t perform that action at this time.
0 commit comments