Skip to content

Commit

Permalink
fix: add webpack ignore patch to dynamic config plugins import (#33)
Browse files Browse the repository at this point in the history
* fix: add webpack ignore patch to dynamic config plugins import

* refactor: upgrade to webpack 5 and enable magic comments

* chore: add run production launch script for testing purposes

* chore: remove unused webpack import in config
  • Loading branch information
byCedric authored May 10, 2021
1 parent b29d27f commit dae77c0
Show file tree
Hide file tree
Showing 5 changed files with 535 additions and 144 deletions.
15 changes: 14 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"version": "0.2.0",
"configurations": [
{
"name": "Run Extension",
"name": "Run Extension (development)",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
Expand All @@ -18,6 +18,19 @@
],
"preLaunchTask": "watch for development"
},
{
"name": "Run Extension (production)",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}"
],
"outFiles": [
"${workspaceFolder}/out/**/*.js"
],
"preLaunchTask": "build for production"
},
{
"name": "Extension Tests",
"type": "extensionHost",
Expand Down
10 changes: 6 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"*"
],
"scripts": {
"postinstall": "patch-package",
"vscode:prepublish": "yarn clean && yarn build:production",
"start": "tsc -watch -p ./",
"build": "tsc -p ./",
Expand All @@ -57,7 +58,7 @@
"@types/vscode": "^1.44.0",
"@typescript-eslint/eslint-plugin": "^4.22.1",
"@typescript-eslint/parser": "^4.22.1",
"babel-loader": "^8.1.0",
"babel-loader": "^8.2.2",
"eslint": "^7.26.0",
"eslint-config-universe": "^7.0.1",
"find-up": "^5.0.0",
Expand All @@ -66,12 +67,13 @@
"jest-environment-node": "^26.6.2",
"json-schema-traverse": "^1.0.0",
"jsonc-parser": "^3.0.0",
"patch-package": "^6.4.7",
"prettier": "^2.1.1",
"shebang-loader": "^0.0.1",
"raw-loader": "^4.0.2",
"typescript": "^4.2.4",
"vsce": "^1.88.0",
"vscode-test": "^1.5.2",
"webpack": "^4.44.1",
"webpack-cli": "^3.3.12"
"webpack": "^5.36.2",
"webpack-cli": "^4.7.0"
}
}
13 changes: 13 additions & 0 deletions patches/@expo+config-plugins+1.0.29.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/node_modules/@expo/config-plugins/build/utils/plugin-resolver.js b/node_modules/@expo/config-plugins/build/utils/plugin-resolver.js
index 424ede4..06df7cb 100644
--- a/node_modules/@expo/config-plugins/build/utils/plugin-resolver.js
+++ b/node_modules/@expo/config-plugins/build/utils/plugin-resolver.js
@@ -148,7 +148,7 @@ function resolveConfigPluginExport({ plugin, pluginFile, pluginReference, isPlug
exports.resolveConfigPluginExport = resolveConfigPluginExport;
function requirePluginFile(filePath) {
try {
- return require(filePath);
+ return require(/* webpackIgnore: true */ filePath);
}
catch (error) {
// TODO: Improve error messages
8 changes: 7 additions & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,15 @@ module.exports = {
extensions: ['.ts', '.js', '.json'],
},
module: {
parser: {
javascript: {
commonjsMagicComments: true,
},
},
rules: [
{
loader: 'shebang-loader',
test: /\.md|LICENSE$/,
loader: 'raw-loader',
},
{
test: /\.(ts|js)$/,
Expand Down
Loading

0 comments on commit dae77c0

Please sign in to comment.