Message Boards

liferay-npm-bundler build error

sunny huang, modified 3 Years ago.

liferay-npm-bundler build error

Junior Member Posts: 56 Join Date: 1/17/11 Recent Posts

HI ALL,

Copy src to New a document-library-web .

(1)    package.json:

{
	"dependencies": {
		"@clayui/alert": "3.4.1",
		"@clayui/button": "3.4.0",
		"@clayui/css": "3.18.1",
		"@clayui/form": "3.11.1",
		"@clayui/icon": "3.0.5",
		"@clayui/loading-indicator": "3.1.0",
		"@clayui/modal": "3.7.2",
		"clay-button": "2.21.4",
		"clay-multi-select": "2.21.4",
		"clay-radio": "2.21.4",
		"clipboard": "2.0.4",
		"prop-types": "15.7.2",
		"react": "16.12.0",
		"react-dom": "16.12.0"
	},
	"name": "document-library-web",
	"private": true,
	"scripts": {
		"build": "babel --source-maps -d build/resources/main/META-INF/resources src/main/resources/META-INF/resources && liferay-npm-bundler"
	},
	"version": "5.0.55",
	"devDependencies": {
		"babel-cli": "^6.26.0",
		"babel-preset-env": "^1.7.0",
		"babel-preset-react": "6.24.1",
		"liferay-npm-bundler": "2.18.2",
		"liferay-npm-bundler-preset-standard": "2.19.3"
	}
}

(2)    .npmbundlerrc:

{
	"config": {
		"imports": {
			"asset-taglib": {
				"/": ">=4.0.0"
			},
			"frontend-taglib-clay": {
				"clay-autocomplete": ">=2.9.0",
				"clay-button": ">=2.9.0",
				"clay-data-provider": ">=2.9.0",
				"clay-icon": ">=2.9.0",
				"clay-label": ">=2.9.0",
				"clay-link": ">=2.9.0",
				"clay-multi-select": ">=2.9.0",
				"clay-portal": ">=2.9.0",
				"clay-radio": ">=2.9.0"
			},
			"frontend-js-metal-web": {
				"metal": ">=2.16.5",
				"metal-component": ">=2.16.5",
				"metal-soy": ">=2.16.5",
				"metal-state": ">=2.16.5",
				"metal-dom": ">=2.16.5"
			},
			"frontend-js-web": {
				"/": ">=3.0.0"
			}
		}
	},
	"ignore": [
		"**/document_library/js/legacy/*.js"
	],
	"dump-report": true,
	"sources": ["src/main/resources/META-INF/resources"],
	"preset": "liferay-npm-bundler-preset-standard"
}

(3)     .babelrc

{
}

build and have error

> babel --source-maps -d build/resources/main/META-INF/resources src/main/resources/META-INF/resources && liferay-npm-bundler

SyntaxError: src/main/resources/META-INF/resources/document_library/js/bulk/BulkStatus.es.js: Unexpected token (97:2)
   95 | 
   96 | 	return (
>  97 | 		<div className="bulk-status-container">
      | 		^
   98 | 			<div className={`bulk-status ${!state.current.show && 'closed'}`}>
   99 | 				<div className="bulk-status-content">
  100 | 					<ClayLoadingIndicator light small />
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! document-library-web@5.0.55 build: `babel --source-maps -d build/resources/main/META-INF/resources src/main/resources/META-INF/resources && liferay-npm-bundler`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the document-library-web@5.0.55 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

and liferay-npm-bundler-report.html as fellow

 

liferay-npm-bundler build error and js not work.

What's the problem? thank you!