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 

and change config

module: {   loaders: [     {test: /\.ejs$/, loader: 'ejs-compiled?htmlmin'} // enable here   ] }, 'ejs-compiled-loader': {   'htmlmin': true, // or enable here     'htmlminoptions': {     removecomments: true   } } 

Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -