Add curly brackets to a whitespace indented module using curlyfy;
npm install --save-dev curlyfy-loader
It should be used in tandem with a curly language loader:
var jsmodule = require("babel!curlyfy!./module.js.noncurly");
var tsmodule = require("typescript!curlyfy!./module.ts.noncurly");
Or within the webpack config:
module: {
loaders: [
{ test: /\.js\.noncurly$/, exclude: /node_modules/, loader: 'babel!curlyfy'},
{ test: /\.ts\.noncurly$/, exclude: /node_modules/, loader: 'typescript!curlyfy'}
]
}
and then require normally:
var jsmodule = require("./module.js.noncurly");
var tsmodule = require("./module.ts.noncurly");
See webpack docs: Using loaders
See the curlyfy options