Skip to content

Commit

Permalink
chore: remove alias setting and let example use package directly
Browse files Browse the repository at this point in the history
  • Loading branch information
leangseu-edx committed Mar 26, 2024
1 parent 273569c commit 8348592
Show file tree
Hide file tree
Showing 5 changed files with 92 additions and 7 deletions.
42 changes: 42 additions & 0 deletions example-plugin-app/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions example-plugin-app/webpack.dev.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ module.exports = createConfig('webpack-dev', {
// applications. Because this example app is using code from the parent frontend-plugin-framework
// library, it runs into the same issues our applications do when loading libraries from
// local source, rather than from their node_modules directory.
'@openedx/frontend-plugin-framework': path.resolve(__dirname, '..', 'src/plugins'),
'@openedx/frontend-plugin-framework': path.resolve(__dirname, '..', 'dist'),
react: path.resolve(__dirname, 'node_modules', 'react'),
'react-dom': path.resolve(__dirname, 'node_modules', 'react-dom'),
'react-router-dom': path.resolve(__dirname, 'node_modules', 'react-router-dom'),
},
},
devServer: {
port: 8081,
port: 8082,
allowedHosts: 'all',
},
});
45 changes: 45 additions & 0 deletions example/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"author": "edX",
"license": "AAGPL-3.0",
"dependencies": {
"@openedx/frontend-plugin-framework": "file:..",
"core-js": "^3.29.1",
"prop-types": "^15.8.1",
"react": "^17.0.0",
Expand Down
7 changes: 2 additions & 5 deletions example/webpack.dev.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,8 @@ const { createConfig } = require('@openedx/frontend-build');
module.exports = createConfig('webpack-dev', {
resolve: {
alias: {
// Note: these four aliases are a manual version of what module.config.js solves in our
// applications. Because this example app is using code from the parent frontend-plugin-framework
// library, it runs into the same issues our applications do when loading libraries from
// local source, rather than from their node_modules directory.
'@openedx/frontend-plugin-framework': path.resolve(__dirname, '..', 'src/plugins'),
// Note: these 3 aliases are a manual version of what module.config.js solves in our
// applications.
react: path.resolve(__dirname, 'node_modules', 'react'),
'react-dom': path.resolve(__dirname, 'node_modules', 'react-dom'),
'react-router-dom': path.resolve(__dirname, 'node_modules', 'react-router-dom'),
Expand Down

0 comments on commit 8348592

Please sign in to comment.