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 #2189

Signed-off-by: Rémi Rahir (rar) <[email protected]>
  • Loading branch information
LucasLefevre committed Mar 8, 2023
1 parent 8ad4c4d commit fccf6dc
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 @@ -24,7 +24,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 @@ -77,7 +77,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()],
},
];
Expand Down

0 comments on commit fccf6dc

Please sign in to comment.