javascript - EJs to HTML, nodejs, webpack -
webpack config:
{ entry: { filename: "./test/output.ejs" }, module: { loaders: [ { test: /\.ejs$/, loader: 'ejs-loader' } ] }, output: { filename: "./test/output.html" } }
my ejs content lorem ipsum text
my output html created, content of not html code, begins this:
/******/ (function(modules) { // webpackbootstrap /******/ // module cache /******/ var installedmodules = {}; /******/ /******/ // require function /******/ function __webpack_require__(moduleid) {
how can return html code?
i can't promise try instead
npm install ejs-compiled-loader
module: { loaders: [ {test: /\.ejs$/, loader: 'ejs-compiled?htmlmin'} // enable here ] }, 'ejs-compiled-loader': { 'htmlmin': true, // or enable here 'htmlminoptions': { removecomments: true } }
Comments
Post a Comment