Code Monkey home page Code Monkey logo

Comments (6)

alexnoz avatar alexnoz commented on June 17, 2024

If I understand you correctly and your html is minified in development, then you can paste this line of code parts.loadPug({ pretty: true }) into the dev config. You can pass any options to Pug this way.

from webpack-pug-scss-boilerplate.

johanguse avatar johanguse commented on June 17, 2024

This what I want!! But, It's doesn't' work...

Error: options/query provided without loader (use loader + options) in {
"test": {},
"use": [
{
"loader": "html-loader"
},
{
"loader": "pug-html-loader"
}
],
"options": {
"pretty": true
}
}
at Function.normalizeRule (W:\code_test\kepical_teste\node_modules\webpack\lib\RuleSet.js:179:10)
at rules.map (W:\code_test\kepical_teste\node_modules\webpack\lib\RuleSet.js:86:20)
at Array.map ()
at Function.normalizeRules (W:\code_test\kepical_teste\node_modules\webpack\lib\RuleSet.js:85:17)
at new RuleSet (W:\code_test\kepical_teste\node_modules\webpack\lib\RuleSet.js:80:24)
at new NormalModuleFactory (W:\code_test\kepical_teste\node_modules\webpack\lib\NormalModuleFactory.js:49:18)
at Compiler.createNormalModuleFactory (W:\code_test\kepical_teste\node_modules\webpack\lib\Compiler.js:480:31)

at Compiler.newCompilationParams (W:\code_test\kepical_teste\node_modules\webpack\lib\Compiler.js:493:30)
at Compiler.compile (W:\code_test\kepical_teste\node_modules\webpack\lib\Compiler.js:501:23)
at compiler.applyPluginsAsync.err (W:\code_test\kepical_teste\node_modules\webpack\lib\Compiler.js:82:18)
at next (W:\code_test\kepical_teste\node_modules\tapable\lib\Tapable.js:202:11)
at Compiler.compilerInvalid (W:\code_test\kepical_teste\node_modules\webpack-dev-middleware\lib\Shared.js:161:
  1. at next (W:\code_test\kepical_teste\node_modules\tapable\lib\Tapable.js:204:14)
    at Compiler.compiler.plugin (W:\code_test\kepical_teste\node_modules\webpack\lib\CachePlugin.js:32:5)
    at next (W:\code_test\kepical_teste\node_modules\tapable\lib\Tapable.js:204:14)
    at linterSuccess (W:\code_test\kepical_teste\node_modules\stylelint-webpack-plugin\lib\run-compilation.js:36:9
    )

from webpack-pug-scss-boilerplate.

alexnoz avatar alexnoz commented on June 17, 2024

I think I've figured it out. First, please, download the new version (1.1.2) of the boilerplate. Then, make the following changes to the webpack.config.js:

Everything should work now.

from webpack-pug-scss-boilerplate.

johanguse avatar johanguse commented on June 17, 2024

I download last version (1.1.2). And and I did the whole process again...
Error only when I put parts.loadPug({ pretty: true }) to dev config.

Failed to compile.

ERROR in ./app/index.pug
Module not found: Error: Can't resolve './""' in 'W:\code_test\webpack-pug-scss\app'
@ ./app/index.pug 1:406-425
@ ./app/scripts/index.js
@ multi (webpack)-dev-server/client?http://localhost:8080 webpack/hot/dev-server ./app/scripts

ERROR in Error: Child compilation failed:
Module not found: Error: Can't resolve './""' in 'W:\code_test\webpack-pug-scss\app':
Error: Can't resolve './""' in 'W:\code_test\webpack-pug-scss\app'

  • compiler.js:76
    [webpack-pug-scss]/[html-webpack-plugin]/lib/compiler.js:76:16

  • Compiler.js:300 compile
    [webpack-pug-scss]/[webpack]/lib/Compiler.js:300:11

  • Compiler.js:510 applyPluginsAsync.err
    [webpack-pug-scss]/[webpack]/lib/Compiler.js:510:14

  • Tapable.js:202 next
    [webpack-pug-scss]/[tapable]/lib/Tapable.js:202:11

  • CachePlugin.js:78 Compiler.
    [webpack-pug-scss]/[webpack]/lib/CachePlugin.js:78:5

  • Tapable.js:206 Compiler.applyPluginsAsyncSeries
    [webpack-pug-scss]/[tapable]/lib/Tapable.js:206:13

  • Compiler.js:507 compilation.seal.err
    [webpack-pug-scss]/[webpack]/lib/Compiler.js:507:11

  • Tapable.js:195 Compilation.applyPluginsAsyncSeries
    [webpack-pug-scss]/[tapable]/lib/Tapable.js:195:46

  • Compilation.js:680 self.applyPluginsAsync.err
    [webpack-pug-scss]/[webpack]/lib/Compilation.js:680:19

  • Tapable.js:195 Compilation.applyPluginsAsyncSeries
    [webpack-pug-scss]/[tapable]/lib/Tapable.js:195:46

  • Compilation.js:671 self.applyPluginsAsync.err
    [webpack-pug-scss]/[webpack]/lib/Compilation.js:671:11

  • Tapable.js:195 Compilation.applyPluginsAsyncSeries
    [webpack-pug-scss]/[tapable]/lib/Tapable.js:195:46

  • Compilation.js:666 self.applyPluginsAsync.err
    [webpack-pug-scss]/[webpack]/lib/Compilation.js:666:10

  • Tapable.js:195 Compilation.applyPluginsAsyncSeries
    [webpack-pug-scss]/[tapable]/lib/Tapable.js:195:46

  • Compilation.js:662 sealPart2
    [webpack-pug-scss]/[webpack]/lib/Compilation.js:662:9

  • Tapable.js:195 Compilation.applyPluginsAsyncSeries
    [webpack-pug-scss]/[tapable]/lib/Tapable.js:195:46

from webpack-pug-scss-boilerplate.

alexnoz avatar alexnoz commented on June 17, 2024

Make sure that you're actually moving this line to the production config and not copying it.

from webpack-pug-scss-boilerplate.

alexnoz avatar alexnoz commented on June 17, 2024

Closed due to lack of activity. Feel free to reopen if the issue is still relevant.

from webpack-pug-scss-boilerplate.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.