Using latest babel preset. My .babelrc contains
{
"presets": ["env"]
}
In my package.json, I run it as follows:
"build:babel": "babel app.js app/** venue/** -d build",
My original code structure is:
But after running babel my build folder looks like the following:
The problem I'm seeing is that it's building the file in the sub-directories correctly but it also putting it into the root build folder. Example: "containers" is in the build folder under app/plugins/containers which is correct. But its also in the root build folder. Also, the files "border, button, card, checkbox, click, color_picker, ..." belong in other sub-directories (which it is), but is also in the root build folder.
I'm wondering if I'm running it incorrectly?
Related
I wrote a VSCode extension and am trying to publish it locally via vsce package. When I install my app through the VSIX file, there's no 'node_modules' folder inside my extension which leads to my extension not loading correctly because no modules are found
I have checked that my required dependencies are indeed inside dependencies and not peerDependencies or devDependencies. I should note that I have a .vscodeingore file containing the following:
.vscode/**
.vscode-test/**
out/test/**
src/**
.gitignore
vsc-extension-quickstart.md
**/tsconfig.json
**/tslint.json
**/*.map
**/*.ts
node_modules
webpack.config.js
I would like that my node_modules be installed and I would see a "node_modules" folder inside my './vscode/extensions/' folder.
Thanks!
Babel doesn't find all of my .js/.es6 files in my directory.
I have this directory structure:
src/
assets/
sample/
models.es6
scripts/
playground.es6
If I run babel src --out-dir dist --source-maps --copy-files --presets env, it only transpiles /src/assets/sample/models.es6 and doesnt go through src/scripts/playground.es6.
What am I doing wrong?
Looking forward to your response!
You can do like below :
babel src/** --out-dir lib
more at official doc
Compile Directories
Compile the entire src directory and output it to the lib directory. You may use --out-dir or -d. This doesn’t overwrite any other files or directories in lib.
if you still stuck, you can use gulp or grunt or webpack to load/transpile mupltiple directives from different locations.
Hope it helps
I found the problem. It has barely to do with Babel.
Inside the src/assets/** is my Realm database sample.realm (https://realm.io). The file itself doesnt cause the problem. But if you open the sample.realm file with Realm Studio on MacOSX, a file called sample.realm.note gets created. This file causes babel to not exit the transpile task.
I was recently trying to debug errors in a next.js getting started project and realized that it didn't like a .babelrc file in a parent directory.
My questions are:
Why is the project throwing an error on a .babelrc configuration file in a parent directory that's not part of the project? Does it recursively look for a babel configuration file in all parent directories or did I at some point configure babel to look at that config file? How can I check what that configuration is?
Is this a quirk of next.js that makes it look for a configuration file in a parent directory?
I forgot if I had added that .babelrc configuration in the parent directory - is that something that I needed? What is the configuration? How should I update it to make the error go away?
ERROR in ./pages/index.js
Module build failed: ReferenceError: [BABEL] /Users/me/Projects/foo/foo-web/pages/index.js:
Using removed Babel 5 option: /Users/me/Projects/.babelrc.optional
- Put the specific transforms you want in the `plugins` option
.babelrc
"optional": ["es7.classProperties"]
babel is looking first .babelrc file is present in the root directory
you have to create the .babelrc file
npm install babel-plugin-transform-runtime
insert to .babelrc
{
"plugins": [
"transform-runtime"
]
}
more info
Using the gulp tasks from the yeoman generated Aurelia app I'm trying to bundle a custom application. When I run gulp bundle the following error is reported.
Where can I find a log to help track down this file or the reference to this file?
Double check your config.js
I've seen this from time to time, and it's usually an issue of the config.js. You'll want to make sure:
The github, npm, or wherever your text plugin is located is above your '*' line.
The text plugin is mapped.
The plugin files are located where (1) and (2) are pointing.
So, something like this:
config.js
paths: {
"github:*": "jspm_packages/github/*",
"npm:*": "jspm_packages/npm/*",
"*": "dist/*"
},
map: {
"text": "github:systemjs/plugin-text#0.0.4"
}
And jspm_packages/github/systemjs/plugin-text#0.0.4 exists.
If all else fails, try deleting your jspm_packages folder, and typing jspm install text.
I have a Scala application and i want to setup a deployment process result similar to one Akka sbt plugin gives, but i it requires project to be a microkernel. Sbt-assembly is a very cool plugin, but i want to have a free access to my config files, basically i want to have the following app structure:
/app/bin - start script bash file
/config - all my application .conf files
/deploy - my project .jar with classes
/lib - all my dependencies .jar files
/logs - log files
I we checked typesafe sbt-native-packager, it's better, but it could place my .conf file and logs out of jars. All those settings in SBT looks confusing to me, what can i do to with this?
Actually this is not hard to update akka-sbt-plugin to make it work in general, add this file to your project folder and somewhere in your build the following settings:
.settings(Distribution.distSettings: _*)
.settings(mappings in Compile in packageBin ~= { _.filter(!_._1.getName.endsWith(".conf")) })
The first line adds all dist settings to your project and the second one excludes all .conf files from your .jar and reads them from config folder.
Now you have to commands: dist - creates a folder with a structure you've discribed and zipDist which packs it all into .zip file, later you can add this to you publish setting:
addArtifact(Artifact(someName, "zip", "zip"), zipDist)