Skip to content

Commit

Permalink
fix: support reference a scss files which installed to node_modules (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
daychongyang authored May 29, 2020
1 parent 8144044 commit d623437
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 3 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@
"@types/postcss-load-config": "^2.0.1",
"@types/serve-handler": "^6.1.0",
"@types/ws": "^7.2.4",
"bootstrap": "^4.5.0",
"conventional-changelog-cli": "^2.0.31",
"cross-env": "^7.0.2",
"jest": "^25.4.0",
Expand Down
5 changes: 3 additions & 2 deletions playground/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
"serve": "serve dist"
},
"dependencies": {
"bootstrap": "link:../node_modules/bootstrap",
"conditional-exports": "link:./conditional-exports",
"lodash-es": "link:../node_modules/lodash-es",
"moment": "link:../node_modules/moment",
"rewrite-optimized-test-package": "link:./rewrite-optimized/test-package",
"resolve-browser-field-test-package": "link:./resolve-browser-field",
"conditional-exports": "link:./conditional-exports"
"rewrite-optimized-test-package": "link:./rewrite-optimized/test-package"
}
}
2 changes: 2 additions & 0 deletions playground/testTransform.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// @import 'bootstrap/scss/bootstrap';

$color: cyan;

.transform-scss {
Expand Down
4 changes: 4 additions & 0 deletions playground/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
# yarn lockfile v1


"bootstrap@link:../node_modules/bootstrap":
version "0.0.0"
uid ""

"conditional-exports@link:./conditional-exports":
version "0.0.0"
uid ""
Expand Down
5 changes: 4 additions & 1 deletion src/node/utils/cssUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,10 @@ export async function compileCss(
postcssOptions: postcssConfig.options,
postcssPlugins: postcssConfig.plugins
}
: {})
: {}),
preprocessOptions: {
includePaths: ['node_modules']
}
})
}

Expand Down
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1318,6 +1318,11 @@ boolbase@^1.0.0, boolbase@~1.0.0:
resolved "https://registry.yarnpkg.com/boolbase/-/boolbase-1.0.0.tgz#68dff5fbe60c51eb37725ea9e3ed310dcc1e776e"
integrity sha1-aN/1++YMUes3cl6p4+0xDcwed24=

bootstrap@^4.5.0:
version "4.5.0"
resolved "https://registry.yarnpkg.com/bootstrap/-/bootstrap-4.5.0.tgz#97d9dbcb5a8972f8722c9962483543b907d9b9ec"
integrity sha512-Z93QoXvodoVslA+PWNdk23Hze4RBYIkpb5h8I2HY2Tu2h7A0LpAgLcyrhrSUyo2/Oxm2l1fRZPs1e5hnxnliXA==

brace-expansion@^1.1.7:
version "1.1.11"
resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd"
Expand Down

0 comments on commit d623437

Please sign in to comment.