babel-loader

react with IE11 is not working, displaying blank screen

大城市里の小女人 提交于 2019-12-07 15:46:29
问题 when trying to load application in IE11 it just shows blank screen and errors with syntax error on this line class App extends __WEBPACK_IMPORTED_MODULE_0_react__["Component"] { my package.json { "name": "ccp-react", "version": "1.0.0", "license": "MIT", "scripts": { "start": "webpack-dev-server", "build": "webpack" }, "private": true, "dependencies": { "babel-plugin-lodash": "^3.3.2", "babel-preset-es2015": "^6.24.1", "babel-preset-react-optimize": "^1.0.1", "babel-preset-stage-1": "^6.24.1"

How to get dynamic imports to work in webpack 4

醉酒当歌 提交于 2019-12-06 06:55:40
问题 I'm trying to migrate my app to webpack 4. My head hurts already. Dynamic imports - this is my method of code splitting (page by page). But I can't get it to work. Have set up very simple tester with following packages: "devDependencies": { "babel-core": "^6.26.3", "babel-loader": "^7.1.4", "babel-plugin-transform-async-to-generator": "^6.24.1", "babel-polyfill": "^6.26.0", "babel-preset-env": "^1.7.0", "babel-preset-react": "^6.24.1", "css-loader": "^0.28.11", "html-loader": "^0.5.5", "html

react with IE11 is not working, displaying blank screen

为君一笑 提交于 2019-12-06 04:50:58
when trying to load application in IE11 it just shows blank screen and errors with syntax error on this line class App extends __WEBPACK_IMPORTED_MODULE_0_react__["Component"] { my package.json { "name": "ccp-react", "version": "1.0.0", "license": "MIT", "scripts": { "start": "webpack-dev-server", "build": "webpack" }, "private": true, "dependencies": { "babel-plugin-lodash": "^3.3.2", "babel-preset-es2015": "^6.24.1", "babel-preset-react-optimize": "^1.0.1", "babel-preset-stage-1": "^6.24.1", "bootstrap": "^3.3.7", "classnames": "^2.2.5", "create-react-class": "^15.6.2", "cross-env": "^5.1.3"

What is the difference between babel-core and @babel/core?

落花浮王杯 提交于 2019-12-04 23:43:41
What is the difference between babel-core and @babel/core ? Are they the same thing but different versions? If not so, when do you use one and when do you use the other? Thank you. Since Babel 7 the Babel team switched to scoped packages , so you now have to use @babel/core instead of babel-core . But in essence, @babel/core is just a newer version of babel-core . This is done to make a better distinction which packages are official and which are third-party. 来源: https://stackoverflow.com/questions/53380741/what-is-the-difference-between-babel-core-and-babel-core

Create React Native App. - Plugin/Preset files are not allowed to export objects, only functions

こ雲淡風輕ζ 提交于 2019-12-04 03:13:03
问题 Need some help, I'm getting a weird error out of left field that I have not been able to debug. This project was bundling successfully until yesterday after I setup my react native project on another Mac. I'm wondering if it's from versioning of npm packages I had to reinstall. Any direction would be helpful, it's always the setup that's the hardest because you do it so infrequently... My babelrc file is as follows -- { "presets": ["babel-preset-expo"], "env": { "development": { "plugins": [

Using Webpack To Transpile ES6 as separate files

断了今生、忘了曾经 提交于 2019-12-03 09:45:17
问题 Is it possible to configure webpack to do the equivalent of: babel src --watch --out-dir lib So that a directory structure that looks like this: - src - alpha - beta.js - charlie - delta.js - echo.js - foxtrot - golf - hotel.js Would compile all the files to ES5 and output them in an identical structure under a lib directory: - lib - alpha - beta.js - charlie - delta.js - echo.js - foxtrot - golf - hotel.js I took a pass at globbing all the filepaths and passing them in as separate entries,

Create React Native App. - Plugin/Preset files are not allowed to export objects, only functions

无人久伴 提交于 2019-12-01 17:46:15
Need some help, I'm getting a weird error out of left field that I have not been able to debug. This project was bundling successfully until yesterday after I setup my react native project on another Mac. I'm wondering if it's from versioning of npm packages I had to reinstall. Any direction would be helpful, it's always the setup that's the hardest because you do it so infrequently... My babelrc file is as follows -- { "presets": ["babel-preset-expo"], "env": { "development": { "plugins": ["transform-react-jsx-source"] } } } And my package.json { "name": "hancho_frontend", "version": "0.1.0",

Unexpected token: operator (>) from UglifyJs

做~自己de王妃 提交于 2019-12-01 03:13:31
I have 2 Vue-Cli webpack projects (ClientApp and Lib). Lib is my components library (shared with other projects) Problem When I build my project ClientApp npm run build , I have the following error: ERROR in static/js/app.d08a24ce0e8d0438ce68.js from UglifyJs Unexpected token: operator (>) [C:/.../Lib/src/tools/escape-key.js:3,0][static/js/app.d08a24ce0e8d0438ce68.js:17468,38] Questions It seems like the error comes from an arrow function in the file escape-key.js . This is ES6 syntax and UglifyJS can't parse this. Shouldn't Babel go first, before Uglify? Note that is works well with *.vue

Unexpected token: operator (>) from UglifyJs

我的梦境 提交于 2019-11-30 22:38:09
问题 I have 2 Vue-Cli webpack projects (ClientApp and Lib). Lib is my components library (shared with other projects) Problem When I build my project ClientApp npm run build , I have the following error: ERROR in static/js/app.d08a24ce0e8d0438ce68.js from UglifyJs Unexpected token: operator (>) [C:/.../Lib/src/tools/escape-key.js:3,0][static/js/app.d08a24ce0e8d0438ce68.js:17468,38] Questions It seems like the error comes from an arrow function in the file escape-key.js . This is ES6 syntax and

babel-preset-env SyntaxError: Unexpected token with spread properties

人走茶凉 提交于 2019-11-30 21:23:12
Why its not accepting spread properties ? I am using babel-preset-env for this. .babelrc { "presets": [ "react", [ "env", { "targets": {}, "debug": true, "modules": "commonjs" } ] ] } package.json { "name": "myapp", "version": "0.1.0", "main": "index.js", "private": true, "dependencies": { "babel-core": "6.25.0", "babel-loader": "7.1.1", "babel-preset-env": "^1.6.0", "babel-preset-react": "^6.24.1", "extract-text-webpack-plugin": "3.0.0", "file-loader": "0.11.2", "html-webpack-plugin": "^2.30.1", "moment": "^2.18.1", "react": "^15.6.1", "react-dom": "^15.6.1", "react-router": "^4.1.2", "react