mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
Overwrite implicit modules only if they are package.json files.
Implicit empty stub CSS modules added in addStylesheet in compiler-plugin.js were being overwritten with actual CSS module code, thanks to logic intended to support replacing package.json stubs with their actual contents. The meaning of "implicit" is somewhat overloaded: for package.json modules, it means the module is a minimal stub (just the "name", "version", and "main"/"browser" fields) that should be replaced if ever explicitly imported. For empty stub CSS modules, it means the module should yield to any actual modules added via addJavaScript.
This commit is contained in:
@@ -562,9 +562,11 @@ export default class ImportScanner {
|
||||
|
||||
let depFile = this._getFile(absImportedPath);
|
||||
if (depFile) {
|
||||
// If the module was imported implicitly before, update to the
|
||||
// If the module is an implicit package.json stub, update to the
|
||||
// explicit version now.
|
||||
if (depFile.implicit === true) {
|
||||
if (depFile.jsonData &&
|
||||
depFile.installPath.endsWith("/package.json") &&
|
||||
depFile.implicit === true) {
|
||||
const file = this._readModule(absImportedPath);
|
||||
if (file) {
|
||||
depFile.implicit = false;
|
||||
|
||||
Reference in New Issue
Block a user