Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

babel-query-loader

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-query-loader

Build babel loader with defaults as an object or string

  • 0.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

purpose

an easy string or object babel loader

installation

npm i --save-dev babel-loader-builder

usage

(in webpack.config)

as a string

  import babelBuilder from 'babel-loader-builder'
  const babelLoaderString = babelBuilder({cacheDirectory: false, moduleExports: false})

  // ...
  loaders: [
    {
      test: /\.js?$/,
      loaders: babelLoaderString,
    }
  ],
  // ...

as an object

import babelBuilder from 'babel-loader-builder'
const babelLoaderObject = babelBuilder({asObject: true, inferno: true, cacheDirectory: false})

// ...
loaders: [
  {
    test: /\.js?$/,
    loaders: 'babel-loader',
    query: loader,
  }
],
// ...

defaults

var defaults = {
  hot: false,
  react: false,
  asObject: false,
  production: false,
  babelrc: false,
  cacheDirectory: true,
  babili: false,
  moduleExports: true,
  inferno: false,
}

todo

  • show required installations if some are missing
  • if they are missing, write out a line that shows the installation npm i command
  • stringify the object queries such as inferno for usage as a string
  • just loop instead of Object.assign, for compatibility, or use polyfill but that seems like overkill

FAQs

Package last updated on 25 Dec 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc