forked from AlchemyCMS/alchemy_cms
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use Alchemy npm package instead of hacking webpacker (AlchemyCMS#1853)
* Move npm package code into dedicated folder We want to get rid of webpacker * Remove rails/webpacker With that we can dramatically simplify the jest setup * Raise npm package version * Install alchemy npm package into host app Instead of compiling the pack in a hacky way we install the alchemy/admin npm package as dependency of the host apps package.json and copy the admin entry point into the host apps packs folder. This reduces the amount of hacks we need in Alchemy in order to make webpack work. * Remove webpacker hacks Now that we publish a npm package and install alchemy/admin as host app dependency we can remove our webpacker hacks. * Remove and ignore webpacker files from dummy app We want to run the install generator during test setup. * Run Alchemy installer during test setup That way we ensure that everything is setup correctly and the generator is actually tested in a sort. * Cache node_modules of dummy app on CI This gem has two node_modules folder now, on in the dummy app and one for the jest specs.
- Loading branch information
Showing
30 changed files
with
57 additions
and
442 deletions.
There are no files selected for viewing
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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,72 +1,12 @@ | ||
module.exports = function (api) { | ||
var validEnv = ["development", "test", "production"] | ||
var currentEnv = api.env() | ||
var isDevelopmentEnv = api.env("development") | ||
var isProductionEnv = api.env("production") | ||
var isTestEnv = api.env("test") | ||
|
||
if (!validEnv.includes(currentEnv)) { | ||
throw new Error( | ||
"Please specify a valid `NODE_ENV` or " + | ||
'`BABEL_ENV` environment variables. Valid values are "development", ' + | ||
'"test", and "production". Instead, received: ' + | ||
JSON.stringify(currentEnv) + | ||
"." | ||
) | ||
} | ||
|
||
return { | ||
presets: [ | ||
isTestEnv && [ | ||
"@babel/preset-env", | ||
{ | ||
targets: { | ||
node: "current" | ||
} | ||
} | ||
], | ||
(isProductionEnv || isDevelopmentEnv) && [ | ||
"@babel/preset-env", | ||
{ | ||
forceAllTransforms: true, | ||
useBuiltIns: "entry", | ||
corejs: 3, | ||
modules: false, | ||
exclude: ["transform-typeof-symbol"] | ||
} | ||
] | ||
].filter(Boolean), | ||
plugins: [ | ||
"babel-plugin-macros", | ||
"@babel/plugin-syntax-dynamic-import", | ||
isTestEnv && "babel-plugin-dynamic-import-node", | ||
"@babel/plugin-transform-destructuring", | ||
[ | ||
"@babel/plugin-proposal-class-properties", | ||
{ | ||
loose: true | ||
} | ||
], | ||
[ | ||
"@babel/plugin-proposal-object-rest-spread", | ||
{ | ||
useBuiltIns: true | ||
} | ||
], | ||
[ | ||
"@babel/plugin-transform-runtime", | ||
{ | ||
helpers: false, | ||
regenerator: true, | ||
corejs: false | ||
} | ||
], | ||
[ | ||
"@babel/plugin-transform-regenerator", | ||
{ | ||
async: false | ||
} | ||
] | ||
].filter(Boolean) | ||
} | ||
module.exports = { | ||
presets: [ | ||
[ | ||
"@babel/preset-env", | ||
{ | ||
targets: { | ||
node: "current" | ||
} | ||
} | ||
] | ||
] | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 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
Oops, something went wrong.