mirror of
https://github.com/kevin-DL/sapper.git
synced 2026-01-20 14:25:07 +00:00
enforce client app treeshakeability
This commit is contained in:
1009
package-lock.json
generated
1009
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -31,6 +31,7 @@
|
|||||||
"@types/mocha": "^5.2.5",
|
"@types/mocha": "^5.2.5",
|
||||||
"@types/node": "^10.7.1",
|
"@types/node": "^10.7.1",
|
||||||
"@types/rimraf": "^2.0.2",
|
"@types/rimraf": "^2.0.2",
|
||||||
|
"agadoo": "^1.0.1",
|
||||||
"cheap-watch": "^0.3.0",
|
"cheap-watch": "^0.3.0",
|
||||||
"compression": "^1.7.1",
|
"compression": "^1.7.1",
|
||||||
"cookie": "^0.3.1",
|
"cookie": "^0.3.1",
|
||||||
@@ -70,7 +71,7 @@
|
|||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"cy:open": "cypress open",
|
"cy:open": "cypress open",
|
||||||
"test": "mocha --opts mocha.opts",
|
"test": "mocha --opts mocha.opts && agadoo templates/dist/client.js",
|
||||||
"pretest": "npm run build",
|
"pretest": "npm run build",
|
||||||
"build": "rm -rf dist && rollup -c",
|
"build": "rm -rf dist && rollup -c",
|
||||||
"prepare": "npm run build",
|
"prepare": "npm run build",
|
||||||
|
|||||||
@@ -49,13 +49,14 @@ export function set_cid(n) {
|
|||||||
cid = n;
|
cid = n;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const initial_data = typeof window !== 'undefined' && window.__SAPPER__;
|
export const initial_data = typeof __SAPPER__ !== 'undefined' && __SAPPER__;
|
||||||
|
|
||||||
export const history = typeof window !== 'undefined' ? window.history : {
|
const _history = typeof history !== 'undefined' ? history : {
|
||||||
pushState: (state: any, title: string, href: string) => {},
|
pushState: (state: any, title: string, href: string) => {},
|
||||||
replaceState: (state: any, title: string, href: string) => {},
|
replaceState: (state: any, title: string, href: string) => {},
|
||||||
scrollRestoration: ''
|
scrollRestoration: ''
|
||||||
};
|
};
|
||||||
|
export { _history as history };
|
||||||
|
|
||||||
export const scroll_history: Record<string, ScrollPosition> = {};
|
export const scroll_history: Record<string, ScrollPosition> = {};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user