@@ -1285,6 +1285,71 @@ module.exports = {
12851285 } ) ;
12861286 } ) ;
12871287
1288+ it ( 'Vue.js is compiled correctly using TypeScript' , ( done ) => {
1289+ const appDir = testSetup . createTestAppDir ( ) ;
1290+
1291+ fs . writeFileSync (
1292+ path . join ( appDir , 'postcss.config.js' ) ,
1293+ `
1294+ module.exports = {
1295+ plugins: [
1296+ require('autoprefixer')()
1297+ ]
1298+ } `
1299+ ) ;
1300+
1301+ const config = testSetup . createWebpackConfig ( appDir , 'www/build' , 'dev' ) ;
1302+ config . enableSingleRuntimeChunk ( ) ;
1303+ config . setPublicPath ( '/build' ) ;
1304+ config . addEntry ( 'main' , './vuejs-typescript/main' ) ;
1305+ config . enableVueLoader ( ) ;
1306+ config . enableSassLoader ( ) ;
1307+ config . enableLessLoader ( ) ;
1308+ config . enableTypeScriptLoader ( ) ;
1309+ config . configureBabel ( function ( config ) {
1310+ config . presets = [
1311+ [ '@babel/preset-env' , {
1312+ 'targets' : {
1313+ 'chrome' : 52
1314+ }
1315+ } ]
1316+ ] ;
1317+ } ) ;
1318+
1319+ testSetup . runWebpack ( config , ( webpackAssert ) => {
1320+ expect ( config . outputPath ) . to . be . a . directory ( ) . with . deep . files ( [
1321+ 'main.js' ,
1322+ 'main.css' ,
1323+ 'images/logo.82b9c7a5.png' ,
1324+ 'manifest.json' ,
1325+ 'entrypoints.json' ,
1326+ 'runtime.js' ,
1327+ ] ) ;
1328+
1329+ // test that our custom babel config is used
1330+ webpackAssert . assertOutputFileContains (
1331+ 'main.js' ,
1332+ 'class TestClassSyntax'
1333+ ) ;
1334+
1335+ testSetup . requestTestPage (
1336+ path . join ( config . getContext ( ) , 'www' ) ,
1337+ [
1338+ 'build/runtime.js' ,
1339+ 'build/main.js'
1340+ ] ,
1341+ ( browser ) => {
1342+ // assert that the vue.js app rendered
1343+ browser . assert . text ( '#app h1' , 'Welcome to Your Vue.js App' ) ;
1344+ // make sure the styles are not inlined
1345+ browser . assert . elements ( 'style' , 0 ) ;
1346+
1347+ done ( ) ;
1348+ }
1349+ ) ;
1350+ } ) ;
1351+ } ) ;
1352+
12881353 it ( 'Vue.js error when using non-activated loaders' , ( done ) => {
12891354 const config = createWebpackConfig ( 'www/build' , 'dev' ) ;
12901355 config . setPublicPath ( '/build' ) ;
0 commit comments