Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to use it under webpack #97

Open
jiucheng-front opened this issue Nov 9, 2017 · 10 comments
Open

how to use it under webpack #97

jiucheng-front opened this issue Nov 9, 2017 · 10 comments

Comments

@jiucheng-front
Copy link

Use webpack configuration development environment, how to use after installing pug-loader?

@drfisher
Copy link

drfisher commented Dec 3, 2017

@wjf444128852 Add this to your loaders list:

loaders: [
  ...
  {
    test: /\.pug$/,
    loader: 'pug-loader'
  },
  ...
]

@jiucheng-front
Copy link
Author

@drfisher TKS,This problem has been solved,
do you know how to include pug template to html ?

@BigLiao
Copy link

BigLiao commented Dec 18, 2017

@wjf444128852 You can use in plugins:
plugins: [ new HtmlWebpackPlugin({ template: './src/index.pug', }) ]

@jiucheng-front
Copy link
Author

@BigLiao TKS a lot

@ffpetrovic
Copy link

You have to alter your webpack config for every new page you want to make? Doesn't it defeat the whole purpose of templating?

@tomasdev
Copy link

tomasdev commented Jun 4, 2018

@ffpetrovic no, it's a configuration thing
From https://stackoverflow.com/questions/44792582/how-to-output-html-files-from-pug-templates-with-webpack

{
    test: /\.pug$/,
    use: [
      "file-loader?name=[path][name].html",
      "extract-loader",
      "html-loader",
      "pug-html-loader"
    ]
  }

@jiucheng-front
Copy link
Author

Tanks a lot, It has been resolved.

@mccxiv
Copy link

mccxiv commented Jul 29, 2018

So yeah, pug-html-loader + html-loader solved my use case. Any way we can emulate that behavior in this package? I'd prefer it here since this one's official 😸

@ghost
Copy link

ghost commented Dec 9, 2019

+1 Still having issues around webpack not being able to include pug.

You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders

@ffpetrovic
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants