@io-arc/webpack-loaders-js

A webpack loader for handling Babel and TypeScript.

Usage#

$ npm i @io-arc/webpack-loaders-js
index.ts
import { yamlLoader } from '@io-arc/webpack-loaders-js'
export default {
// (abbreviation)
module: {
rules: [yamlLoader]
}
}

Variables#

yamlLoader#

Return: webpack.RuleSetRule

Read YAML files.
Install required of npm i -D yaml-loader.

workerLoader#

Return: webpack.RuleSetRule

Create a webWorker files.
Install required of npm i -D worker-loader.

babelLoader#

Return: webpack.RuleSetRule

Babel to JavaScript files.
Install required of npm i -D babel-loader @babel/core @babel/preset-env

Functions#

TypescriptLoader(vue)#

Return: webpack.RuleSetRule

TypeScript to JavaScript files.

Parameters

paramstypedefaultdescription
vue (optional)booleanfalseUsing Vue.js

Install of npm i -D ts-loader

EslintLoader(eslint)#

Return: webpack.RuleSetRule

Using EsLint.
Install required of npm i -D eslint-loader.

Parameters

paramstypedefaultdescription
eslint (optional)string''Eslint file path
Eslint file of project root if empty