GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - matAtWork/nodent-loader

BranchesTags
Open more actions menu

Latest commit

 

History

9 Commits
9 Commits

Folders and files

NameName
Last commit message
Last commit date
.gitignore
.gitignore
 
 
README.md
README.md
 
 
nodent-loader.js
nodent-loader.js
 
 
package.json
package.json
 
 

Repository files navigation

nodent-loader

Purpose

nodent-loader will transform ES7 async/await statements used in source files loaded by webpack using nodent to produce code that is suitable for consumption by other loaders (e.g. babel) or for webpack output.

Typical usage

In your webpack.config.js:

{
	module: {
		loaders: [
			{
				test: /\.js$/,
				loader: 'nodent-loader',
				exclude: /(node_modules)/
			}
		]
	}
}

Configuration

A query can be specified which will pass the options to the nodent compiler.

The can be defined by following the format (specified by loader-utils):

null                   -> {}
?                      -> {}
?flag                  -> { flag: true }
?+flag                 -> { flag: true }
?-flag                 -> { flag: false }
?xyz=test              -> { xyz: "test" }
?xyz[]=a               -> { xyz: ["a"] }
?flag1&flag2           -> { flag1: true, flag2: true }
?+flag1,-flag2         -> { flag1: true, flag2: false }
?xyz[]=a,xyz[]=b       -> { xyz: ["a", "b"] }
?a%2C%26b=c%2C%26d     -> { "a,&b": "c,&d" }
?{json:5,data:{a:1}}   -> { json: 5, data: { a: 1 } }

E.g.

{
	module: {
		loaders: [
			{
				test: /\.js$/,
				loader: 'nodent-loader?+promises,+wrapAwait',
				exclude: /(node_modules)/,
			}
		]
	}
}

or by passing an object to the query property

{
	module: {
		loaders: [
			{
				test: /\.js$/,
				loader: 'nodent-loader',
				exclude: /(node_modules)/,
				query: {
					promises: true,
					wrapAwait: true
				}
			}
		]
	}
}

Todo

  • Add tests

About

No description, website, or topics provided.

Resources

Readme
Activity

Stars

0 stars

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.