diff --git a/template/package.json b/template/package.json index 84506f61..57580cb5 100644 --- a/template/package.json +++ b/template/package.json @@ -4,9 +4,10 @@ "main": "index.js", "license": "MIT", "scripts": { - "build:development": "webpack --mode=development && jahia-pack", - "build:production": "webpack && jahia-pack", + "build:development": "webpack --mode=development && run pack", + "build:production": "webpack && run pack", "build": "run build:production", + "pack": "mkdir -p dist/build && cd dist/build && yarn pack --out package.tgz && mv package.tgz ..", "clean": "rm -rf dist/", "deploy": "jahia-deploy", "watch": "webpack --mode=development --watch", @@ -30,7 +31,6 @@ "@babel/preset-env": "^7.16.4", "@babel/preset-react": "^7.16.0", "@jahia/eslint-config": "^2.1.2", - "@jahia/scripts": "^1.3.7", "babel-loader": "^8.2.3", "babel-plugin-transform-react-remove-prop-types": "^0.4.24", "clean-webpack-plugin": "^4.0.0", diff --git a/template/webpack.config.js b/template/webpack.config.js index 82647d05..c698bee2 100644 --- a/template/webpack.config.js +++ b/template/webpack.config.js @@ -199,7 +199,7 @@ module.exports = (env, argv) => { new WebpackShellPluginNext({ onAfterDone: { scripts: [ - 'yarn jahia-pack', + 'yarn run pack', 'yarn jahia-deploy', process.platform === 'win32' ? 'timeout ' + sleepTime : 'sleep ' + sleepTime ], diff --git a/tests/create-templatesSet-project.test.js b/tests/create-templatesSet-project.test.js index ca419187..5db69865 100644 --- a/tests/create-templatesSet-project.test.js +++ b/tests/create-templatesSet-project.test.js @@ -79,7 +79,7 @@ describe('npx @jahia/create-module', () => { console.log(execSync('yarn build').toString()); // Make sure the tgz file is created in the dist/ folder - const tgzFilePath = path.join(projectPath, 'dist', `${projectName}-v0.1.0-SNAPSHOT.tgz`); + const tgzFilePath = path.join(projectPath, 'dist', 'package.tgz'); expect(fs.existsSync(tgzFilePath)).toBe(true); // Check the contents of the tgz file