Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

Commit

Permalink
Merge pull request #441 from silentworks/bugfix/legacy-manifest
Browse files Browse the repository at this point in the history
Fix for legacy manifest file
  • Loading branch information
Rich-Harris authored Sep 19, 2018
2 parents 8c07d9d + 467041a commit 91182ad
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
3 changes: 2 additions & 1 deletion src/api/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
1 change: 1 addition & 0 deletions src/core/create_compilers/extract_css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`;

This comment has been minimized.

Copy link
@ispyinternet

ispyinternet Sep 19, 2018

I may be being dumb but can you reassign const main here?

This comment has been minimized.

Copy link
@Rich-Harris

Rich-Harris Sep 19, 2018

Author Member

huh. no, no you can't... we're getting away with it because TypeScript converts it to a var. Will fix

const entry = fs.readFileSync(`${dirs.dest}/client/${main}`, 'utf-8');

const replacements = new Map();
Expand Down

0 comments on commit 91182ad

Please sign in to comment.