Skip to content

Commit

Permalink
Fix ssr by packaging src & point svelte to src in package.json
Browse files Browse the repository at this point in the history
  • Loading branch information
nirmaoz authored and Nir Maoz committed Apr 20, 2021
1 parent 06b70b4 commit c0d6b33
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 14 deletions.
15 changes: 8 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"homepage": "http://cloudinary.com",
"license": "MIT",
"version": "0.0.1-alpha.1",
"svelte": "dist/cloudinary-svelte.mjs",
"svelte": "src/index.js",
"module": "dist/cloudinary-svelte.mjs",
"main": "dist/cloudinary-svelte.js",
"repository": {
Expand All @@ -25,8 +25,8 @@
"devDependencies": {
"@babel/core": "^7.9.0",
"@babel/preset-env": "^7.9.0",
"@rollup/plugin-commonjs": "^13.0.0",
"@rollup/plugin-node-resolve": "^8.1.0",
"@rollup/plugin-commonjs": "^13.0.2",
"@rollup/plugin-node-resolve": "^8.4.0",
"@storybook/addon-actions": "^5.3.18",
"@storybook/addon-docs": "^5.3.18",
"@storybook/addon-links": "^5.3.18",
Expand All @@ -38,9 +38,9 @@
"babel-loader": "^8.1.0",
"del-cli": "^3.0.1",
"jest": "^26.1.0",
"rollup": "^2.18.0",
"rollup-plugin-svelte": "^5.2.3",
"rollup-plugin-terser": "^6.1.0",
"rollup": "^2.45.2",
"rollup-plugin-svelte": "^7.1.0",
"rollup-plugin-terser": "^7.0.2",
"svelte": "^3.23.2",
"svelte-jester": "^1.0.6",
"svelte-loader": "^2.13.6"
Expand All @@ -50,7 +50,8 @@
"cloudinary"
],
"files": [
"dist"
"dist",
"src"
],
"dependencies": {
"cloudinary-core": "^2.10.3"
Expand Down
24 changes: 17 additions & 7 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,26 @@ export default {
plugins: [
resolve(),
svelte(),
commonjs({
commonjs(
/*
* This is left here for reference
* The namedExports option from "@rollup/plugin-commonjs" is deprecated.
* Named exports are now handled automatically.
*/

/*
{
// We need this to be able to import Cloudinary from cloudinary-core,
// because it is bundled as commonjs + named export.
// Otherwise Rollup won't be able to import it.
namedExports: {
// left-hand side can be an absolute path, a path
// relative to the current directory, or the name
// of a module in node_modules
'cloudinary-core': ['Cloudinary']
namedExports: {
// left-hand side can be an absolute path, a path
// relative to the current directory, or the name
// of a module in node_modules
'cloudinary-core': ['Cloudinary']
}
}
})
*/
)
]
};

0 comments on commit c0d6b33

Please sign in to comment.