From 467041a3cd3183a3c06ccdae88f44cc8677e0ae6 Mon Sep 17 00:00:00 2001 From: Andrew Smith Date: Thu, 13 Sep 2018 19:45:30 +0100 Subject: [PATCH] Fix for legacy manifest file --- package.json | 1 + src/api/build.ts | 3 ++- src/core/create_compilers/extract_css.ts | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 7748922ab..c5be7eedd 100644 --- a/package.json +++ b/package.json @@ -74,6 +74,7 @@ "test": "mocha --opts mocha.opts", "pretest": "npm run build", "build": "rm -rf dist && rollup -c", + "prepare": "npm run build", "dev": "rollup -cw", "prepublishOnly": "npm test", "update_mime_types": "curl http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types | grep -e \"^[^#]\" > src/middleware/mime-types.md" diff --git a/src/api/build.ts b/src/api/build.ts index e6090b3e2..431564094 100644 --- a/src/api/build.ts +++ b/src/api/build.ts @@ -79,7 +79,8 @@ async function execute(emitter: EventEmitter, opts: Opts, dirs: Dirs) { // TODO duration/warnings result: client_result }); - + + client_result.to_json(manifest_data, dirs); build_info.legacy_assets = client_result.assets; delete process.env.SAPPER_LEGACY_BUILD; } diff --git a/src/core/create_compilers/extract_css.ts b/src/core/create_compilers/extract_css.ts index 6791ab69c..634da73ab 100644 --- a/src/core/create_compilers/extract_css.ts +++ b/src/core/create_compilers/extract_css.ts @@ -170,6 +170,7 @@ export default function extract_css(client_result: CompileResult, components: Pa } const main = client_result.assets.main; + if (process.env.SAPPER_LEGACY_BUILD) main = `legacy/${main}`; const entry = fs.readFileSync(`${dirs.dest}/client/${main}`, 'utf-8'); const replacements = new Map();