Skip to content

Commit

Permalink
[FIX] package: correctly name package entry files
Browse files Browse the repository at this point in the history
Files are named o-spreadsheet[...] in package.json but
rollup generates o_spreadsheet[...] files

as a result any import fails because it's looking for a file that doesn't exist

`import { Model } from @odoo/o-spreadsheet`

=> Error: Cannot find module '/home/odoo/odoo/upgrade-spreadsheet-data/node_modules/@odoo/o-spreadsheet/dist/o-spreadsheet.cjs.js'.
   Please verify that the package.json has a valid "main" entry

closes #2194

X-original-commit: ebc1eed
Signed-off-by: Rémi Rahir (rar) <[email protected]>
Signed-off-by: Lucas Lefèvre (lul) <[email protected]>
  • Loading branch information
LucasLefevre committed Mar 9, 2023
1 parent 89d3c01 commit c3a773f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"main": "dist/o-spreadsheet.cjs.js",
"browser": "dist/o-spreadsheet.iife.js",
"module": "dist/o-spreadsheet.es.js",
"types": "dist/o_spreadsheet.d.ts",
"types": "dist/o-spreadsheet.d.ts",
"files": [
"dist/*.js",
"dist/*.d.ts"
Expand Down
4 changes: 2 additions & 2 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ __info__.hash = '${commitHash}';
*/
function getConfigForFormat(format, minified = false) {
return {
file: minified ? `dist/o_spreadsheet.${format}.min.js` : `dist/o_spreadsheet.${format}.js`,
file: minified ? `dist/o-spreadsheet.${format}.min.js` : `dist/o-spreadsheet.${format}.js`,
format,
name: "o_spreadsheet",
extend: true,
Expand Down Expand Up @@ -78,7 +78,7 @@ export default (commandLineArgs) => {
},
{
input: "dist/types/index.d.ts",
output: [{ file: "dist/o_spreadsheet.d.ts", format: "es" }],
output: [{ file: "dist/o-spreadsheet.d.ts", format: "es" }],
plugins: [dts(), nodeResolve()],
},
];
Expand Down

0 comments on commit c3a773f

Please sign in to comment.