-
Notifications
You must be signed in to change notification settings - Fork 300
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use node resolver module and add opt dependencies
- Loading branch information
Showing
10 changed files
with
72 additions
and
140 deletions.
There are no files selected for viewing
11 changes: 5 additions & 6 deletions
11
packages/electrode-archetype-react-component-dev/config/archetype.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 8 additions & 16 deletions
24
packages/electrode-archetype-react-component-dev/config/webpack/partial/resolve-loader.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,15 @@ | ||
"use strict"; | ||
|
||
const Path = require("path"); | ||
const archetypeNodeModules = Path.join( | ||
// A normal `require.resolve` looks at `package.json:main`. We instead want | ||
// just the _directory_ of the module. So use heuristic of finding dir of | ||
// package.json which **must** exist at a predictable location. | ||
Path.dirname(require.resolve("electrode-archetype-react-component/package.json")), | ||
"node_modules" | ||
); | ||
const archetypeDevNodeModules = Path.join(__dirname, "../../", "node_modules"); | ||
const archetype = require("electrode-archetype-react-component/config/archetype"); | ||
const archetypeNodeModules = Path.join(archetype.dir, "node_modules"); | ||
const archetypeDevNodeModules = Path.join(archetype.devDir, "node_modules"); | ||
const ModuleResolver = require("electrode-node-resolver/lib/webpack-plugin"); | ||
|
||
module.exports = { | ||
resolveLoader: { | ||
modules: [ | ||
archetypeNodeModules, | ||
archetypeDevNodeModules, | ||
"node_modules", | ||
process.cwd() | ||
], | ||
extensions: [".js", ".jsx"] | ||
modules: [archetypeNodeModules, archetypeDevNodeModules, "node_modules", process.cwd()], | ||
extensions: [".js", ".jsx"], | ||
plugins: [new ModuleResolver("module", "resolve", archetype.devDir, undefined)] | ||
} | ||
} | ||
}; |
15 changes: 5 additions & 10 deletions
15
packages/electrode-archetype-react-component-dev/config/webpack/partial/resolve.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
92 changes: 0 additions & 92 deletions
92
packages/electrode-archetype-react-component-dev/config/webpack/plugins/module-resolver.js
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters