jsn-loader
v1.0.4
Published
This is webpack loader to convert your javascript code to json file and access it by path
Downloads
4
Maintainers
Readme
jsn-loader
This is webpack loader converts your dynamic configuration to static.
Usage
Just add the loader to your webpack configuration
module.exports = {
module: {
rules: [
{
test: /\.jsn$/,
use: 'jsn-loader'
}
]
}
};
Example
Before
This is your dynamic configuration file
const os = require("os");
var foo = 1;
module.exports = {
bar: foo + 1,
foo: foo++,
arr: ["npm", "run", "start"].join(" "),
platform: os.platform()
};
After
This is your static configuration file
{
"bar": 2,
"foo": 2,
"arr": "npm run start",
"platform": "linux"
}