Jump to content

Recommended Posts

Bonjour,

 

Je viens vers vous car je ne comprend pas une chose. J'utilise PrestaShop 1.7.1.1.

 

J'ai mis en place l'environnement de développement afin de modifier quelque peu le CSS du thème classic.

J'ai donc fait mon composer install. Et j'ai lancé ma tâche npm run watch dans le dossier _dev.

 

Jusque là, pas de problème mon code compile. Cependant impossible de compiler quand je met une URL en relatif dans le code.

 

Exemple pour compiler une nouvelle typo :

@font-face {
    font-family: "Flaticon";
    src: url("../fonts/Flaticon.eot");
    src: url("../fonts/fonts/Flaticon.eot?#iefix") format("embedded-opentype"),
       url("../fonts/Flaticon.woff") format("woff"),
       url("../fonts/Flaticon.ttf") format("truetype"),
       url("../fonts/Flaticon.svg#Flaticon") format("svg");
    font-weight: normal;
    font-style: normal;
}

@media screen and (-webkit-min-device-pixel-ratio:0) {
    @font-face {
        font-family: "Flaticon";
        src: url("../fonts/Flaticon.svg#Flaticon") format("svg");
    }
}

Voici le message de retour du compilateur :

ERROR in ./~/css-loader?sourceMap!./~/postcss-loader!./~/sass-loader?sourceMap!./css/theme.scss
Module not found: Error: Cannot resolve 'file' or 'directory' ../fonts/Flaticon.eot in C:\wamp\www\comptoirdestruffes\themes\classic\_dev\css
 @ ./~/css-loader?sourceMap!./~/postcss-loader!./~/sass-loader?sourceMap!./css/theme.scss 6:95146-95178

ERROR in ./~/css-loader?sourceMap!./~/postcss-loader!./~/sass-loader?sourceMap!./css/theme.scss
Module not found: Error: Cannot resolve 'file' or 'directory' ../fonts/fonts/Flaticon.eot in C:\wamp\www\comptoirdestruffes\themes\classic\_dev\css
 @ ./~/css-loader?sourceMap!./~/postcss-loader!./~/sass-loader?sourceMap!./css/theme.scss 6:95196-95234

ERROR in ./~/css-loader?sourceMap!./~/postcss-loader!./~/sass-loader?sourceMap!./css/theme.scss
Module not found: Error: Cannot resolve 'file' or 'directory' ../fonts/Flaticon.woff in C:\wamp\www\comptoirdestruffes\themes\classic\_dev\css
 @ ./~/css-loader?sourceMap!./~/postcss-loader!./~/sass-loader?sourceMap!./css/theme.scss 6:95285-95318

ERROR in ./~/css-loader?sourceMap!./~/postcss-loader!./~/sass-loader?sourceMap!./css/theme.scss
Module not found: Error: Cannot resolve 'file' or 'directory' ../fonts/Flaticon.ttf in C:\wamp\www\comptoirdestruffes\themes\classic\_dev\css
 @ ./~/css-loader?sourceMap!./~/postcss-loader!./~/sass-loader?sourceMap!./css/theme.scss 6:95349-95381

ERROR in ./~/css-loader?sourceMap!./~/postcss-loader!./~/sass-loader?sourceMap!./css/theme.scss
Module not found: Error: Cannot resolve 'file' or 'directory' ../fonts/Flaticon.svg in C:\wamp\www\comptoirdestruffes\themes\classic\_dev\css
 @ ./~/css-loader?sourceMap!./~/postcss-loader!./~/sass-loader?sourceMap!./css/theme.scss 6:95416-95448 6:95610-95642

ERROR in ./css/theme.scss
Module build failed: ModuleNotFoundError: Module not found: Error: Cannot resolve 'file' or 'directory' ../fonts/Flaticon.eot in C:\wamp\www\comptoirdestruffes\themes\classic\_dev\css
    at C:\wamp\www\comptoirdestruffes\themes\classic\_dev\node_modules\webpack\lib\Compilation.js:229:38
    at onDoneResolving (C:\wamp\www\comptoirdestruffes\themes\classic\_dev\node_modules\webpack\lib\NormalModuleFactory.js:29:20)
    at C:\wamp\www\comptoirdestruffes\themes\classic\_dev\node_modules\webpack\lib\NormalModuleFactory.js:85:20
    at C:\wamp\www\comptoirdestruffes\themes\classic\_dev\node_modules\async\lib\async.js:726:13
    at C:\wamp\www\comptoirdestruffes\themes\classic\_dev\node_modules\async\lib\async.js:52:16
    at done (C:\wamp\www\comptoirdestruffes\themes\classic\_dev\node_modules\async\lib\async.js:241:17)
    at C:\wamp\www\comptoirdestruffes\themes\classic\_dev\node_modules\async\lib\async.js:44:16
    at C:\wamp\www\comptoirdestruffes\themes\classic\_dev\node_modules\async\lib\async.js:723:17
    at C:\wamp\www\comptoirdestruffes\themes\classic\_dev\node_modules\async\lib\async.js:167:37
    at C:\wamp\www\comptoirdestruffes\themes\classic\_dev\node_modules\enhanced-resolve\lib\UnsafeCachePlugin.js:24:19
    at onResolved (C:\wamp\www\comptoirdestruffes\themes\classic\_dev\node_modules\enhanced-resolve\lib\Resolver.js:38:18)
    at C:\wamp\www\comptoirdestruffes\themes\classic\_dev\node_modules\enhanced-resolve\lib\Resolver.js:127:10
    at C:\wamp\www\comptoirdestruffes\themes\classic\_dev\node_modules\enhanced-resolve\lib\Resolver.js:191:15
    at applyPluginsParallelBailResult.createInnerCallback.log (C:\wamp\www\comptoirdestruffes\themes\classic\_dev\node_modules\enhanced-resolve\lib\Resolver.js:110:4)
    at loggingCallbackWrapper (C:\wamp\www\comptoirdestruffes\themes\classic\_dev\node_modules\enhanced-resolve\lib\createInnerCallback.js:21:19)
    at C:\wamp\www\comptoirdestruffes\themes\classic\_dev\node_modules\tapable\lib\Tapable.js:134:6
    at Tapable.<anonymous> (C:\wamp\www\comptoirdestruffes\themes\classic\_dev\node_modules\enhanced-resolve\lib\DirectoryDefaultFilePlugin.js:21:12)
    at Storage.provide (C:\wamp\www\comptoirdestruffes\themes\classic\_dev\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:52:20)
    at CachedInputFileSystem.stat (C:\wamp\www\comptoirdestruffes\themes\classic\_dev\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:132:20)
    at Tapable.<anonymous> (C:\wamp\www\comptoirdestruffes\themes\classic\_dev\node_modules\enhanced-resolve\lib\DirectoryDefaultFilePlugin.js:18:6)
    at Tapable.applyPluginsParallelBailResult (C:\wamp\www\comptoirdestruffes\themes\classic\_dev\node_modules\tapable\lib\Tapable.js:139:14)
    at Tapable.<anonymous> (C:\wamp\www\comptoirdestruffes\themes\classic\_dev\node_modules\enhanced-resolve\lib\Resolver.js:103:8)
    at Tapable.Resolver.forEachBail (C:\wamp\www\comptoirdestruffes\themes\classic\_dev\node_modules\enhanced-resolve\lib\Resolver.js:196:3)
    at Tapable.doResolve (C:\wamp\www\comptoirdestruffes\themes\classic\_dev\node_modules\enhanced-resolve\lib\Resolver.js:102:7)
    at Tapable.resolve (C:\wamp\www\comptoirdestruffes\themes\classic\_dev\node_modules\enhanced-resolve\lib\Resolver.js:45:14)
    at Tapable.resolve (C:\wamp\www\comptoirdestruffes\themes\classic\_dev\node_modules\enhanced-resolve\lib\UnsafeCachePlugin.js:23:14)
    at C:\wamp\www\comptoirdestruffes\themes\classic\_dev\node_modules\webpack\lib\NormalModuleFactory.js:82:29
    at C:\wamp\www\comptoirdestruffes\themes\classic\_dev\node_modules\async\lib\async.js:718:13
    at async.forEachOf.async.eachOf (C:\wamp\www\comptoirdestruffes\themes\classic\_dev\node_modules\async\lib\async.js:233:13)
    at _parallel (C:\wamp\www\comptoirdestruffes\themes\classic\_dev\node_modules\async\lib\async.js:717:9)
Child extract-text-webpack-plugin:
        + 47 hidden modules

    ERROR in ./~/css-loader?sourceMap!./~/postcss-loader!./~/sass-loader?sourceMap!./css/theme.scss
    Module not found: Error: Cannot resolve 'file' or 'directory' ../fonts/Flaticon.eot in C:\wamp\www\comptoirdestruffes\themes\classic\_dev\css
     @ ./~/css-loader?sourceMap!./~/postcss-loader!./~/sass-loader?sourceMap!./css/theme.scss 6:95146-95178

    ERROR in ./~/css-loader?sourceMap!./~/postcss-loader!./~/sass-loader?sourceMap!./css/theme.scss
    Module not found: Error: Cannot resolve 'file' or 'directory' ../fonts/fonts/Flaticon.eot in C:\wamp\www\comptoirdestruffes\themes\classic\_dev\css
     @ ./~/css-loader?sourceMap!./~/postcss-loader!./~/sass-loader?sourceMap!./css/theme.scss 6:95196-95234

    ERROR in ./~/css-loader?sourceMap!./~/postcss-loader!./~/sass-loader?sourceMap!./css/theme.scss
    Module not found: Error: Cannot resolve 'file' or 'directory' ../fonts/Flaticon.woff in C:\wamp\www\comptoirdestruffes\themes\classic\_dev\css
     @ ./~/css-loader?sourceMap!./~/postcss-loader!./~/sass-loader?sourceMap!./css/theme.scss 6:95285-95318

    ERROR in ./~/css-loader?sourceMap!./~/postcss-loader!./~/sass-loader?sourceMap!./css/theme.scss
    Module not found: Error: Cannot resolve 'file' or 'directory' ../fonts/Flaticon.ttf in C:\wamp\www\comptoirdestruffes\themes\classic\_dev\css
     @ ./~/css-loader?sourceMap!./~/postcss-loader!./~/sass-loader?sourceMap!./css/theme.scss 6:95349-95381

    ERROR in ./~/css-loader?sourceMap!./~/postcss-loader!./~/sass-loader?sourceMap!./css/theme.scss
    Module not found: Error: Cannot resolve 'file' or 'directory' ../fonts/Flaticon.svg in C:\wamp\www\comptoirdestruffes\themes\classic\_dev\css
     @ ./~/css-loader?sourceMap!./~/postcss-loader!./~/sass-loader?sourceMap!./css/theme.scss 6:95416-95448 6:95610-95642

Apparemment il comprend l'URL comme le path d'un module. Pour info, quand je met mon path en dur tout fonctionne bien (du genre http://localhost/comptoirdestruffes/....)

 

Avez-vous la solution ?

 

Merci par avance !

 

Will

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More