airport-clean-ls-loader
v1.0.3
Published
webpack loader to select LS langagues to include in build phase.
Readme
This is a package to use with airport-js or airport-react to remove unused languages in LS.
- https://www.npmjs.com/package/airport-js
- https://www.npmjs.com/package/airport-react
installation
- Make sure you have
typescriptandwebpackinstalled in your project
npm install -D airport-clean-ls-loader typescript webpack
yarn add -D airport-clean-ls-loader typescript webpackParameters
process.env.AIRPORT_CLEAN_LS_FN_NAME: function name to check LS. Usually the name of the function created usingcreateLSFactory(). default iscreateLSprocess.env.AIRPORT_CLEAN_LS_LANGS_TO_REMOVE: insert language codes to delete combined with,
Example Usage:
AIRPORT_CLEAN_LS_LANGS_TO_REMOVE=ko,en yarn build// next.config.js
const moduleExports = {
webpack: (config, { isServer, defaultLoaders, webpack }) => {
config.module.rules.push({
test: /\.tsx?$/,
use: [{ loader: 'airport-clean-ls-loader' }],
})
return config
},
}