Remove usage of `require.extensions` in `parser-glimmer.js` (#6658)

* Fix usage of `require.extensions`

* try cjs build

* update comment
master
fisker Cheung 2019-10-16 00:00:32 +08:00 committed by Lipis
parent d4537dc5f2
commit b5cc13a5df
2 changed files with 14 additions and 2 deletions

View File

@ -99,7 +99,7 @@ async function run(params) {
await execa("rm", ["-rf", ".cache"]);
}
const bundleCache = new Cache(".cache/", "v16");
const bundleCache = new Cache(".cache/", "v17");
await bundleCache.load();
console.log(chalk.inverse(" Building packages "));

View File

@ -92,9 +92,21 @@ const parsers = [
{
input: "src/language-handlebars/parser-glimmer.js",
target: "universal",
alias: {
entries: [
// `handlebars` causes webpack warning by using `require.extensions`
// `dist/handlebars.js` also complaint on `window` variable
// use cjs build instead
// https://github.com/prettier/prettier/issues/6656
{
find: "handlebars",
replacement: require.resolve("handlebars/dist/cjs/handlebars.js")
}
]
},
commonjs: {
namedExports: {
"node_modules/handlebars/lib/index.js": ["parse"],
"node_modules/handlebars/dist/cjs/handlebars.js": ["parse"],
"node_modules/@glimmer/syntax/dist/modules/es2017/index.js": "default"
},
ignore: ["source-map"]