grrr-amsterdam / cookie-consent

Cookie consent with accessible dialog, agnostic tag triggers and conditional content, script and embed hooks.
MIT License
63 stars 11 forks source link

How to compile the js/css #13

Open Mte90 opened 3 years ago

Mte90 commented 3 years ago

It is not clear how to compile it, the wiki has a page https://github.com/grrr-amsterdam/cookie-consent/wiki/Usage-with-build-tools but there are no commands for any of them.

Also for Babel there is already a config file and the various releases don't include any ready js/css file to embed it.

Mte90 commented 3 years ago

I was able to compile it with rollup.

rollup.config.js:

import { nodeResolve } from '@rollup/plugin-node-resolve';

export default {
  input: 'index.mjs',
  output: {
    dir: 'dist',
    format: 'iife',
    name: 'CookieConsent'
  },
  plugins: [nodeResolve()]
};
nikelone commented 3 years ago

Hi same issue here. I made it almost build with webpack 5 and babel with these settings,


 {
        test: /\.m?js$/,
        resolve: {
          fullySpecified: false,
          extensions: ['.wasm', '.mjs', '.js', '.jsx', '.json', '.scss', '.css'],
        },
        use: {
          loader: 'babel-loader',
          options: {
            presets: ['@babel/preset-env'],
          },
        },
      }