@webpackon/core
v1.1.6
Published
Webpackon core
Downloads
69
Maintainers
Readme
@webpackon/core
Utils collection for webpackon.
Install
npm i @webpackon/core --save
yarn add @webpackon/core
Utils
compose
Used for composition webpackon decorators. Decorators applied from right to left or upwards.
Example
const path = require('path');
const { compose } = require('@webpackon/core');
const { useCss } = require('@webpackon/use-css');
const { useBabel } = require('@webpackon/use-babel');
module.exports = (_, { mode }) =>
compose(
useCss({ mode }),
useBabel()
)({
target: 'web',
entry: path.resolve(__dirname, 'src', 'index.jsx'),
});
isProduction
Example
const path = require('path');
const { compose, isProduction } = require('@webpackon/core');
const { useCss } = require('@webpackon/use-css');
const { useBabel } = require('@webpackon/use-babel');
module.exports = (_, { mode }) =>
compose(
useCss({ mode }),
useBabel()
)({
target: 'web',
entry: path.resolve(__dirname, 'src', 'index.jsx'),
output: {
clean: isProduction(mode)
}
});
isDevelopment
Example
const path = require('path');
const { compose, isDevelopment } = require('@webpackon/core');
const { useCss } = require('@webpackon/use-css');
const { useBabel } = require('@webpackon/use-babel');
module.exports = (_, { mode }) =>
compose(
useCss({ mode }),
useBabel()
)({
target: 'web',
entry: path.resolve(__dirname, 'src', 'index.jsx'),
output: {
clean: !isProduction(mode)
}
});