diff --git a/docs/index.html b/docs/index.html index bd6784d4..b77ea5b3 100644 --- a/docs/index.html +++ b/docs/index.html @@ -8,7 +8,7 @@ - + - + diff --git a/package.json b/package.json index 89d5d24b..8df303ac 100644 --- a/package.json +++ b/package.json @@ -48,4 +48,4 @@ "yarn": "1.22.10", "npm": "7.11.2" } -} +} \ No newline at end of file diff --git a/src/code-store.js b/src/code-store.js index 90525bc3..d2bce33b 100644 --- a/src/code-store.js +++ b/src/code-store.js @@ -39,9 +39,11 @@ export const updateConfig = (config, updateEditor) => { codeStore.set({ ...state, mermaid: config, updateEditor }); }; -const unsubscribe = codeStore.subscribe((state) => { - const currentLocation = get(location).split('/')[1]; - replace( - `/${currentLocation || 'edit'}/` + Base64.encodeURI(JSON.stringify(state)) - ); -}); +export const initURLSubscription = () => { + codeStore.subscribe((state) => { + const currentLocation = get(location).split('/')[1]; + replace( + `/${currentLocation || 'edit'}/` + Base64.encodeURI(JSON.stringify(state)) + ); + }); +}; diff --git a/src/routes/Edit.svelte b/src/routes/Edit.svelte index 5c4cde41..ea578deb 100755 --- a/src/routes/Edit.svelte +++ b/src/routes/Edit.svelte @@ -1,6 +1,11 @@ diff --git a/webpack.config.js b/webpack.config.js index 12f43a98..28e20b8e 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -19,7 +19,7 @@ module.exports = { mainFields: ['svelte', 'browser', 'module', 'main'], }, output: { - path: __dirname + '/docs/dist', + path: path.join(__dirname, '/docs'), filename: '[name].js', chunkFilename: '[name].[id].js', },