File tree Expand file tree Collapse file tree 5 files changed +42
-0
lines changed Expand file tree Collapse file tree 5 files changed +42
-0
lines changed Original file line number Diff line number Diff line change 1+ // There seems to be an issue with the sass-loader and prefixing
2+ // aliased directories with a tilde. The following line is how
3+ // this import should look and works for node_modules.
4+ // @import '~lib/test-pkg';
5+
6+ // Importing without the tilde seems to work for webpack aliases
7+ @import ' lib/test-pkg' ;
Original file line number Diff line number Diff line change 1+ $content :' Sass entrypoint' ;
2+
3+ body {
4+ content :$content ;
5+ }
Original file line number Diff line number Diff line change 1+ "use strict" ;
2+
3+ document . write ( "JavaScript entrypoint" ) ;
Original file line number Diff line number Diff line change 1+ {
2+ "name" :" @symfony/webpack-encore-test-pkg" ,
3+ "description" : " This is a test package for use by functional tests which use packages." ,
4+ "author" : {
5+ "name" : " David Ellingsworth" ,
6+ "email" : " david@desource.org"
7+ },
8+ "main" :" js/javascript_entry.js" ,
9+ "sass" :" css/sass_entry.scss"
10+ }
Original file line number Diff line number Diff line change @@ -1972,5 +1972,22 @@ module.exports = {
19721972 } ) ;
19731973 } ) ;
19741974 } ) ;
1975+
1976+ describe ( 'Package entrypoint imports' , ( ) => {
1977+ it ( 'Import via "sass" package property' , ( done ) => {
1978+ const config = createWebpackConfig ( 'web/build' , 'dev' ) ;
1979+
1980+ config . setPublicPath ( '/build' ) ;
1981+ config . addAliases ( {
1982+ lib :path . resolve ( './lib' )
1983+ } ) ;
1984+ config . enableSassLoader ( ) ;
1985+ config . addStyleEntry ( 'sass' , './css/sass_package_import.scss' ) ;
1986+
1987+ testSetup . runWebpack ( config , ( ) => {
1988+ done ( ) ;
1989+ } )
1990+ } ) ;
1991+ } ) ;
19751992 } ) ;
19761993} ) ;
You can’t perform that action at this time.
0 commit comments