const webpack = require("webpack");
const path = require("path");

let config = {
    mode: 'development',
    devtool: "source-map",
    entry: [
        "./src/assets/js/quartiers_de_demain.js",
       
        // "./src/assets/js/animated_logo.js",
        "./src/assets/js/animated_formes.js",
        "./src/assets/js/lightbox.js",
        "./src/assets/js/header.js",
        "./src/assets/js/timeline.js",
        "./src/assets/js/ressources.js",
        "./src/assets/scss/quartiers_de_demain.scss", 
        // "./src/assets/fonts/*",
        // "./src/assets/css/animated_logo.css",

    ],
    
    output: {
        path: path.resolve(__dirname, "./dist/assets"),
        filename: "./bundle.js"
    },

    module: {
        rules: [
            {
                test: /\.scss$/i,
                use: [

                    {
                        loader: 'file-loader',
                        options: {
                            name: './css/bundle.css',
                        }
                    },
                    // Compile le Sass en CSS
                    "sass-loader"
                ],
            },
            {
                test: /\.(png|svg|jpg|jpeg|gif)$/i,
                type: 'asset/resource',
            },
            {
                test: /\.(woff(2)?|ttf|eot|svg)(\?v=\d+\.\d+\.\d+)?$/,
                use: [
                  {
                    loader: 'file-loader',
                    options: {
                      name: '[name].[ext]',
                      outputPath: 'fonts/'
                    }
                  },
                  {
                    loader: 'postcss-loader',
                    options: {
                      sourceMap: true,
                      config: {
                        path: 'postcss.config.js'
                      }
                    }
                  },
                ]
            },
            

            
        ],
        
    },

    externals: {
      drupal: 'Drupal',
      Drupal: 'Drupal',
    },
}





module.exports = config;


