@@ -104,15 +104,15 @@ describe('Functional tests using webpack', function() {
104
104
webpackAssert . assertOutputJsonFileMatches ( 'entrypoints.json' , {
105
105
entrypoints : {
106
106
main : {
107
- js : [ 'build/runtime.js' , 'build/main.js' ]
107
+ js : [ '/ build/runtime.js' , '/ build/main.js' ]
108
108
} ,
109
109
font : {
110
- js : [ 'build/runtime.js' ] ,
111
- css : [ 'build/font.css' ]
110
+ js : [ '/ build/runtime.js' ] ,
111
+ css : [ '/ build/font.css' ]
112
112
} ,
113
113
bg : {
114
- js : [ 'build/runtime.js' ] ,
115
- css : [ 'build/bg.css' ]
114
+ js : [ '/ build/runtime.js' ] ,
115
+ css : [ '/ build/bg.css' ]
116
116
}
117
117
}
118
118
} ) ;
@@ -135,12 +135,12 @@ describe('Functional tests using webpack', function() {
135
135
webpackAssert . assertOutputJsonFileMatches ( 'entrypoints.json' , {
136
136
entrypoints : {
137
137
main : {
138
- js : [ 'build/runtime.js' , 'build/vendors~main~other.js' , 'build/main~other.js' , 'build/main.js' ] ,
139
- css : [ 'build/main~other.css' ]
138
+ js : [ '/ build/runtime.js' , '/ build/vendors~main~other.js' , '/ build/main~other.js' , '/ build/main.js' ] ,
139
+ css : [ '/ build/main~other.css' ]
140
140
} ,
141
141
other : {
142
- js : [ 'build/runtime.js' , 'build/vendors~main~other.js' , 'build/main~other.js' , 'build/other.js' ] ,
143
- css : [ 'build/main~other.css' ]
142
+ js : [ '/ build/runtime.js' , '/ build/vendors~main~other.js' , '/ build/main~other.js' , '/ build/other.js' ] ,
143
+ css : [ '/ build/main~other.css' ]
144
144
}
145
145
}
146
146
} ) ;
@@ -695,12 +695,12 @@ describe('Functional tests using webpack', function() {
695
695
webpackAssert . assertOutputJsonFileMatches ( 'entrypoints.json' , {
696
696
entrypoints : {
697
697
main : {
698
- js : [ 'build/runtime.js' , 'build/shared.js' , 'build/main.js' ] ,
699
- css : [ 'build/shared.css' ]
698
+ js : [ '/ build/runtime.js' , '/ build/shared.js' , '/ build/main.js' ] ,
699
+ css : [ '/ build/shared.css' ]
700
700
} ,
701
701
other : {
702
- js : [ 'build/runtime.js' , 'build/shared.js' , 'build/other.js' ] ,
703
- css : [ 'build/shared.css' ]
702
+ js : [ '/ build/runtime.js' , '/ build/shared.js' , '/ build/other.js' ] ,
703
+ css : [ '/ build/shared.css' ]
704
704
}
705
705
}
706
706
} ) ;
@@ -1621,12 +1621,12 @@ module.exports = {
1621
1621
webpackAssert . assertOutputJsonFileMatches ( 'entrypoints.json' , {
1622
1622
entrypoints : {
1623
1623
main : {
1624
- js : [ 'build/runtime.js' , 'build/vendors~main~other.js' , 'build/main~other.js' , 'build/main.js' ] ,
1625
- css : [ 'build/main~other.css' ]
1624
+ js : [ '/ build/runtime.js' , '/ build/vendors~main~other.js' , '/ build/main~other.js' , '/ build/main.js' ] ,
1625
+ css : [ '/ build/main~other.css' ]
1626
1626
} ,
1627
1627
other : {
1628
- js : [ 'build/runtime.js' , 'build/vendors~main~other.js' , 'build/main~other.js' , 'build/other.js' ] ,
1629
- css : [ 'build/main~other.css' ]
1628
+ js : [ '/ build/runtime.js' , '/ build/vendors~main~other.js' , '/ build/main~other.js' , '/ build/other.js' ] ,
1629
+ css : [ '/ build/main~other.css' ]
1630
1630
}
1631
1631
}
1632
1632
} ) ;
@@ -1680,6 +1680,48 @@ module.exports = {
1680
1680
} ) ;
1681
1681
} ) ;
1682
1682
1683
+ it ( 'Subdirectory public path affects entrypoints.json but does not affect manifest.json' , ( done ) => {
1684
+ const config = createWebpackConfig ( 'web/build' , 'dev' ) ;
1685
+ config . addEntry ( 'main' , [ './css/roboto_font.css' , './js/no_require' , 'vue' ] ) ;
1686
+ config . addEntry ( 'other' , [ './css/roboto_font.css' , 'vue' ] ) ;
1687
+ config . setPublicPath ( '/subdirectory/build' ) ;
1688
+ config . setManifestKeyPrefix ( 'custom_prefix' ) ;
1689
+ config . configureSplitChunks ( ( splitChunks ) => {
1690
+ splitChunks . chunks = 'all' ;
1691
+ splitChunks . minSize = 0 ;
1692
+ } ) ;
1693
+
1694
+ testSetup . runWebpack ( config , ( webpackAssert ) => {
1695
+ webpackAssert . assertOutputJsonFileMatches ( 'entrypoints.json' , {
1696
+ entrypoints : {
1697
+ main : {
1698
+ js : [
1699
+ '/subdirectory/build/runtime.js' ,
1700
+ '/subdirectory/build/vendors~main~other.js' ,
1701
+ '/subdirectory/build/main~other.js' ,
1702
+ '/subdirectory/build/main.js'
1703
+ ] ,
1704
+ css : [ '/subdirectory/build/main~other.css' ]
1705
+ } ,
1706
+ other : {
1707
+ js : [
1708
+ '/subdirectory/build/runtime.js' ,
1709
+ '/subdirectory/build/vendors~main~other.js' ,
1710
+ '/subdirectory/build/main~other.js' ,
1711
+ '/subdirectory/build/other.js'
1712
+ ] ,
1713
+ css : [ '/subdirectory/build/main~other.css' ]
1714
+ }
1715
+ }
1716
+ } ) ;
1717
+
1718
+ // make split chunks are correct in manifest
1719
+ webpackAssert . assertManifestKeyExists ( 'custom_prefix/vendors~main~other.js' ) ;
1720
+
1721
+ done ( ) ;
1722
+ } ) ;
1723
+ } ) ;
1724
+
1683
1725
it ( 'Use splitChunks in production mode' , ( done ) => {
1684
1726
const config = createWebpackConfig ( 'web/build' , 'production' ) ;
1685
1727
config . addEntry ( 'main' , [ './css/roboto_font.css' , './js/no_require' , 'vue' ] ) ;
@@ -1695,12 +1737,12 @@ module.exports = {
1695
1737
webpackAssert . assertOutputJsonFileMatches ( 'entrypoints.json' , {
1696
1738
entrypoints : {
1697
1739
main : {
1698
- js : [ 'build/runtime.js' , 'build/vendors~cc515e6e.js' , 'build/default~cc515e6e.js' , 'build/main.js' ] ,
1699
- css : [ 'build/default~cc515e6e.css' ]
1740
+ js : [ '/ build/runtime.js' , '/ build/vendors~cc515e6e.js' , '/ build/default~cc515e6e.js' , '/ build/main.js' ] ,
1741
+ css : [ '/ build/default~cc515e6e.css' ]
1700
1742
} ,
1701
1743
other : {
1702
- js : [ 'build/runtime.js' , 'build/vendors~cc515e6e.js' , 'build/default~cc515e6e.js' , 'build/other.js' ] ,
1703
- css : [ 'build/default~cc515e6e.css' ]
1744
+ js : [ '/ build/runtime.js' , '/ build/vendors~cc515e6e.js' , '/ build/default~cc515e6e.js' , '/ build/other.js' ] ,
1745
+ css : [ '/ build/default~cc515e6e.css' ]
1704
1746
}
1705
1747
}
1706
1748
} ) ;
@@ -1726,12 +1768,12 @@ module.exports = {
1726
1768
webpackAssert . assertOutputJsonFileMatches ( 'entrypoints.json' , {
1727
1769
entrypoints : {
1728
1770
main : {
1729
- js : [ 'build/runtime.js' , 'build/vendors~main~other.js' , 'build/main.js' ]
1771
+ js : [ '/ build/runtime.js' , '/ build/vendors~main~other.js' , '/ build/main.js' ]
1730
1772
} ,
1731
1773
other : {
1732
1774
// the 0.[hash].js is because the "no_require" module was already split to this
1733
1775
// so, it has that filename, instead of following the normal pattern
1734
- js : [ 'build/runtime.js' , 'build/vendors~main~other.js' , 'build/0.js' , 'build/other.js' ]
1776
+ js : [ '/ build/runtime.js' , '/ build/vendors~main~other.js' , '/ build/0.js' , '/ build/other.js' ]
1735
1777
}
1736
1778
}
1737
1779
} ) ;
0 commit comments