NPM run build error in static/JS/ balabala.js from UglifyJs
The project added a small requirement, and an error was reported when it was ready to be deployed to the developer for testing.
ERROR in static/js/1.e54ac17.js from UglifyJs
Unexpected token: name (FusionClass) [static/js/1.e54ac17.js:55,6]
ERROR in static/js/vendor.bd8bfa0.js from UglifyJs
Unexpected token: name (ret) [static/js/vendor.bd8bfa0.js:11551,6]
From the error message, we can see that the syntax of ES6 in JS has not been converted to Es5. I think a new dependency has been added. It may be that part of the syntax of ES6 is used in the dependency, but there is no escape.
{
test: /\.js$/,
loader: 'babel-loader',
options: {
presets: ['es2015']
},
include: [resolve('src'), resolve('test')]
}
The above is the configuration of webpack. It can be found that the ES6 conversion in the dependency file is not supported, so we can write in the new dependency.
{
test: /\.js$/,
loader: 'babel-loader',
options: {
presets: ['es2015']
},
include: [resolve('src'), resolve('test'), resolve('/node_modules/your package')]
}
Just repack it.
Read More:
- Resources is configured in the build of Maven project to prevent the failure of resource export
- [Solved] Npm -v Error: Cannot find module npm_cli
- [Solved] Error running ‘tomcat:run‘: Cannot run program “tomcat:run“
- Abstract method and static method of java interface
- Problems and causes of Java’s main function format (public static void main (string args()))
- [Solved] Springboot loads static page Error: whitelabel error page
- Build a mybatis and it will appear session.selectOne Method error
- [Solved] Java Run Error: For input string: “XXX”
- [Solved] jar Run Error: no main manifest attribute
- Error:Abnormal build process termination [How to Solve]
- [Solved] Jenkins Publish to rancher Error: ERROR: Build step failed with exception java.lang.ClassCastException: class com.
- Error:Cannot build artifact xxx:war exploded’ because it is included into a circular dependency
- How to Solve Spring Boot Maven Build Error
- [Solved] the resource is not on the build path of a java project
- [Solved] Idea Build error. The symbol — Lombok cannot be found
- [Solved] Docker-maven-plugin Build Mirror Error: failed: Connection refused: connect
- How to Solve ERROR: Java 1.7 or later is required to run Apache Drill
- [Solved] MVN Build Project Error: Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M5:test
- [Solved] Hive Run SQL error: mapreduce failed to initiate a task
- [Solved] ‘build.plugins.plugin.version‘ for org.springframework.boot:spring-boot-maven-plugin is missing.