const-module-loader
v0.1.1
Published
<h1 align="center">const-module-loader</h1>
Downloads
3
Readme
Installation
# NPM
$ npm install const-module-loader
# Yarn
$ yarn add const-module-loader
# PNPM
$ pnpm add const-module-loader
# Bun
$ bun add const-module-loader
Usage
Depending on what framework you are using your configuration will look slightly different. If you are using a Vite based framework you should instead look towards vite-plugin-const, which is the same functionality but for Vite based frameworks.
Webpack
Add const-module-loader
as a module rules in your webpack.config.js
.
module.exports = {
//...
module: {
rules: [
{
test: /\.const.ts/,
use: [{ loader: "const-module-loader" }],
},
],
},
};
NextJS
Add const-module-loader
as a module rules in the webpack section of your next.config.mjs
.
/** @type {import('next').NextConfig} */
const nextConfig = {
webpack: (
config,
{ buildId, dev, isServer, defaultLoaders, nextRuntime, webpack }
) => {
config.module.rules.push({
test: /\.const.ts/,
use: [{ loader: "const-module-loader" }],
});
return config;
},
};
License
Distributed under the MIT License. See LICENSE for more information.