Open MontyMa opened 6 years ago
need more information please . how can you ask for help just like that
I am facing the same problem.
I created a new Angular 8 project and added ngx-build-plus
. I changed the package.json
and altered the build
script: "build": "ng build --extra-webpack-config extra-webpack.config.js"
. When running the build script, the raw content of the .pug
file is added to the generated main.js
. When running the build
script with the --prod
attribute, I get the following error:
ERROR in : Template parse errors:
Unexpected character "EOF" (Do you have an unescaped "{" in your template? Use "{{ '{' }}") to escape it.) ("\u003C\u002Fh2\u003E\n\u003C\u002Fdiv\u003E";;return pug_html;};
module.exports = template;[ERROR ->]"): <project-path>/src/app/app.component.pug@4:26
Invalid ICU message. Missing '}'. ("\u003C\u002Fh2\u003E\n\u003C\u002Fdiv\u003E";;return pug_html;};
module.exports = template;[ERROR ->]"): <project-path>/src/app/app.component.pug@4:26
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! <project>@0.0.0 build:prod: `ng build --prod --extra-webpack-config extra-webpack.config.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the <project>@0.0.0 build:prod script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
My extra-webpack.config.js
looks lilke this:
module.exports = {
module: {
rules: [
{
test: /\.pug$/,
use: [
{ loader: 'raw-loader' },
{
loader: 'pug-loader',
options: {
'doctype': 'html',
'pretty': true,
'plugins': [
'pug-plugin-ng'
]
}
}
]
}
]
}
};
And the app.component.ts
look like:
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.pug',
styleUrls: ['./app.component.css']
})
export class AppComponent {
}
This setup worked perfectly before Angular 8. So I guess something changed there.
same issue here when i config configureWebpack
in vue.config.js
with vue/cli
~
could anybody give some help?
`pug = require("!../../../node_modules/pug-runtime/index.js");