Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource


Babel is required to process package imports. If you need a different preprocessor remove all packages first.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource


Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.






                const path = require('path')
const htmlWebpackPlugin = require('html-webpack-plugin')
const miniCssExtractPlugin = require('mini-css-extract-plugin')
const glob = require('glob')
const copy = require('copy-webpack-plugin')

let config = {
  entry: './src/index.js',
  output: {
    filename: 'main.js',
    path: path.resolve(__dirname, 'dist')
  module: {
    rules: [
        test: /\.js$/,
        exclude: /(node_modules)/,
        use: ['babel-loader']
        //only for Tailwindcss
        test: /\.css$/,
        use: [
          { loader: 'css-loader', options: { importLoaders: 1 } },
        test: /\.s[ac]ss$/i,
        use: [
          // Creates `style` nodes from JS strings
          // Translates CSS into CommonJS
          // Compiles Sass to CSS
        test: /\.ejs$/,
        use: ['ejs-loader']
  plugins: [
    new miniCssExtractPlugin({
      filename: 'style.css'
    // Copy all images in ./src/img/* to /dist/img in PROD
    new copy([
        context: __dirname + '/src/img',
        from: '*',
        to: __dirname + '/dist/img'
        // from: 'src/img/*',
        // to: './img'

//get all files with .ejs extension
// process.cwd() she will look the current directory with the command in terminal
// autrement dit, ça ira directement à la racinne du projet
const files = glob.sync(process.cwd() + '/src/views/*.ejs')

//boucle sur tous les fichiers réccupérés
//ensuite sur chaque fichiers on va lancer la config webpack
//pour que le plugin htmlWebpackPlugin puisse bosser sur chaque fichier
//et ainsi sortir un html correct
files.forEach(file => {
  config.plugins.push(new htmlWebpackPlugin({
    filename: path.basename(file).replace('.ejs', '.html'),
    template: file
module.exports = config