babeljs

Concatenate files using babel

回眸只為那壹抹淺笑 提交于 2021-02-15 02:50:41
问题 Here's my file structure /base.js /foo/main.js /foo/bar/main.js /baz/main.js I want 4 files in total. One for each leaf node of the tree with all the content of it's 'included' files. Here are file's contents. base.js //anything really /foo/main.js include 'base.js' /foo/bar/main.js include 'base.js' include '/foo/main.js' /baz/main.js include 'base.js' These 'includes' are like php includes in that they are concatenated at babel's compile time not the traditional includes from es2016/es2016.

Concatenate files using babel

喜你入骨 提交于 2021-02-15 02:47:36
问题 Here's my file structure /base.js /foo/main.js /foo/bar/main.js /baz/main.js I want 4 files in total. One for each leaf node of the tree with all the content of it's 'included' files. Here are file's contents. base.js //anything really /foo/main.js include 'base.js' /foo/bar/main.js include 'base.js' include '/foo/main.js' /baz/main.js include 'base.js' These 'includes' are like php includes in that they are concatenated at babel's compile time not the traditional includes from es2016/es2016.

Concatenate files using babel

一个人想着一个人 提交于 2021-02-15 02:45:03
问题 Here's my file structure /base.js /foo/main.js /foo/bar/main.js /baz/main.js I want 4 files in total. One for each leaf node of the tree with all the content of it's 'included' files. Here are file's contents. base.js //anything really /foo/main.js include 'base.js' /foo/bar/main.js include 'base.js' include '/foo/main.js' /baz/main.js include 'base.js' These 'includes' are like php includes in that they are concatenated at babel's compile time not the traditional includes from es2016/es2016.

Concatenate files using babel

拟墨画扇 提交于 2021-02-15 02:44:09
问题 Here's my file structure /base.js /foo/main.js /foo/bar/main.js /baz/main.js I want 4 files in total. One for each leaf node of the tree with all the content of it's 'included' files. Here are file's contents. base.js //anything really /foo/main.js include 'base.js' /foo/bar/main.js include 'base.js' include '/foo/main.js' /baz/main.js include 'base.js' These 'includes' are like php includes in that they are concatenated at babel's compile time not the traditional includes from es2016/es2016.

Jest import statement: 'TypeError: Cannot set property 'fillStyle' of null'

半世苍凉 提交于 2021-02-11 15:20:47
问题 I type: npm test and I get: It's interesting to note that the import statement works inside the BootScene.test.js file but it doesn't work in the imported file. I focused on the import statement not working under JEst. So I thought maybe it has something to do with Ecma Script version jest uses. So I tried this solution but the error persists. This is the repo/branch of this question. When I type npm start . Everything flows swiftly and with no errors. 回答1: I solved it by following this

Support for the experimental syntax 'classProperties' isn't currently enabled (8:16). Add @babel/plugin-proposal-class-properties

有些话、适合烂在心里 提交于 2021-02-11 14:15:07
问题 I'm trying to compile my React Native App and I'm getting the following error: SyntaxError: C:\Users\Ori\Desktop\Projects\React\my-app\node_modules@react-native-community\google-signin\src\GoogleSignin.js: Support for the experimental syntax 'classProperties' isn't currently enabled (8:16) Add @babel/plugin-proposal-class-properties (https://git.io/vb4SL) to the 'plugins' section of your Babel config to enable transformation. If I understand correctly, since it is a react native app, the

[NODEMON]- babel-node not recognized as internal or external command

孤人 提交于 2021-02-11 13:18:23
问题 I am trying to setup a simple express server. I am using nodemon to start my development server But my app keeps crashing because it does not recognize the "babel-node" command. The error output is [nodemon] 2.0.7 [nodemon] to restart at any time, enter `rs` [nodemon] watching path(s): *.* [nodemon] watching extensions: js,json [nodemon] starting `babel-node index.js` 'babel-node' is not recognized as an internal or external command, operable program or batch file. [nodemon] app crashed -

How to setup jest with node_modules that use es6

人盡茶涼 提交于 2021-02-11 06:58:19
问题 I have a very simple test: describe('sanity', () => { it('sanity', () => { expect(true).toBeTruthy() }) }) And I'm receiving the following error: FAIL spec/javascript/sanity_test.js ● Test suite failed to run Jest encountered an unexpected token This usually means that you are trying to import a file which Jest cannot parse, e.g. it's not plain JavaScript. By default, if Jest sees a Babel config, it will use that to transform your files, ignoring "node_modules". Here's what you can do: • To

Object doesn't support property or method 'replace' on Internet Explorer 11

折月煮酒 提交于 2021-02-10 16:41:28
问题 I am trying to make my Vuejs application work on IE11. However, one node module ( vue-directive-tooltip ) throw an error on IE11: Object doesn't support property or methode "replace" The module is supposed to be IE11 compatible. I have tried to require the polyfill I need at the top of the entry point to my application. I have also tried to add the node module to the transpile dependencies. vue.config.js: require("@babel/polyfill"); configureWebpack: { entry: ["@babel/polyfill", path.resolve(

Babel: replaceWithSourceString giving Unexpected token (1:1)

限于喜欢 提交于 2021-02-10 06:50:32
问题 I am trying to replace dynamically "import" statements. Here is an example that checks if the import ends with a Plus. module.exports = function(babel) { return { visitor: { ImportDeclaration: function(path, state) { // import abc from "./logic/+" if( ! path.node.source.value.endsWith("/+")) return; path.replaceWithSourceString('import all from "./logic/all"') } } } } This gives an error of SyntaxError: src/boom.js: Unexpected token (1:1) - make sure this is an expression. > 1 | (import all