@@ -948,6 +948,7 @@ module.exports = {
948948 // load a file that @import 's another file, so that we can
949949 // test that @import resources are parsed through postcss
950950 config . addStyleEntry ( 'styles' , [ './css/imports_autoprefixer.css' ] ) ;
951+ config . addStyleEntry ( 'postcss' , './css/postcss_extension.postcss' ) ;
951952 config . enablePostCssLoader ( ) ;
952953
953954 testSetup . runWebpack ( config , ( webpackAssert ) => {
@@ -957,6 +958,14 @@ module.exports = {
957958 '-webkit-full-screen'
958959 ) ;
959960
961+ // check that the .postcss file was also processed
962+ // correctly (it also @import the autoprefixer_test.css
963+ // file)
964+ webpackAssert . assertOutputFileContains (
965+ 'postcss.css' ,
966+ '-webkit-full-screen'
967+ ) ;
968+
960969 done ( ) ;
961970 } ) ;
962971 } ) ;
@@ -1421,7 +1430,7 @@ module.exports = {
14211430 } ) ;
14221431 } ) ;
14231432
1424- it ( 'Vue.js supports CSS/Sass/Less/Stylus modules' , ( done ) => {
1433+ it ( 'Vue.js supports CSS/Sass/Less/Stylus/PostCSS modules' , ( done ) => {
14251434 const appDir = testSetup . createTestAppDir ( ) ;
14261435 const config = testSetup . createWebpackConfig ( appDir , 'www/build' , 'dev' ) ;
14271436 config . enableSingleRuntimeChunk ( ) ;
@@ -1437,6 +1446,18 @@ module.exports = {
14371446 options . localIdentName = '[local]_foo' ;
14381447 } ) ;
14391448
1449+ // Enable the PostCSS loader so we can use `lang="postcss"`
1450+ config . enablePostCssLoader ( ) ;
1451+ fs . writeFileSync (
1452+ path . join ( appDir , 'postcss.config.js' ) ,
1453+ `
1454+ module.exports = {
1455+ plugins: [
1456+ require('autoprefixer')()
1457+ ]
1458+ } `
1459+ ) ;
1460+
14401461 testSetup . runWebpack ( config , ( webpackAssert ) => {
14411462 expect ( config . outputPath ) . to . be . a . directory ( ) . with . deep . files ( [
14421463 'main.js' ,
@@ -1457,11 +1478,13 @@ module.exports = {
14571478 expectClassDeclaration ( 'large' ) ; // Standard SCSS
14581479 expectClassDeclaration ( 'justified' ) ; // Standard Less
14591480 expectClassDeclaration ( 'lowercase' ) ; // Standard Stylus
1481+ expectClassDeclaration ( 'block' ) ; // Standard Postcss
14601482
14611483 expectClassDeclaration ( 'italic_foo' ) ; // CSS Module
14621484 expectClassDeclaration ( 'bold_foo' ) ; // SCSS Module
14631485 expectClassDeclaration ( 'underline_foo' ) ; // Less Module
14641486 expectClassDeclaration ( 'rtl_foo' ) ; // Stylus Module
1487+ expectClassDeclaration ( 'hidden_foo' ) ; // Stylus Module
14651488
14661489 testSetup . requestTestPage (
14671490 path . join ( config . getContext ( ) , 'www' ) ,
@@ -1474,11 +1497,13 @@ module.exports = {
14741497 browser . assert . hasClass ( '#app' , 'large' ) ; // Standard SCSS
14751498 browser . assert . hasClass ( '#app' , 'justified' ) ; // Standard Less
14761499 browser . assert . hasClass ( '#app' , 'lowercase' ) ; // Standard Stylus
1500+ browser . assert . hasClass ( '#app' , 'block' ) ; // Standard Stylus
14771501
14781502 browser . assert . hasClass ( '#app' , 'italic_foo' ) ; // CSS module
14791503 browser . assert . hasClass ( '#app' , 'bold_foo' ) ; // SCSS module
14801504 browser . assert . hasClass ( '#app' , 'underline_foo' ) ; // Less module
14811505 browser . assert . hasClass ( '#app' , 'rtl_foo' ) ; // Stylus module
1506+ browser . assert . hasClass ( '#app' , 'hidden_foo' ) ; // Stylus module
14821507
14831508 done ( ) ;
14841509 }
0 commit comments