Coder Social home page Coder Social logo

lopatnov / rollup-plugin-uglify Goto Github PK

View Code? Open in Web Editor NEW
7.0 1.0 2.0 914 KB

A rollup plugin to minify javascript with Terser

Home Page: https://lopatnov.github.io/rollup-plugin-uglify/

License: Apache License 2.0

JavaScript 79.93% TypeScript 20.07%
rollup-plugin uglify terser typescript javascript rollup

rollup-plugin-uglify's People

Contributors

danielart avatar dependabot[bot] avatar lopatnov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

danielart paceaux

rollup-plugin-uglify's Issues

CI/CD Error: Cannot find module @rollup/pluginutils


Ci/CD pipeline shows
"cannot find module ' @rollup/pluginutils'

Require stack:

  • /node_modules/@lopatnov/rollup-plugin-uglify/dist/plugin.js
  • rollup.config.js
  • /node_modules/rollup/dist/shared/loadConfigFile.js
  • /node_modules/rollup/dist/bin/rollup

** To reproduce: **
Rollup and @lopatnov/rollup-plugin-uglify are dependencies in a Drupal project.

We have the following rollup devdependencies:

    "@lopatnov/rollup-plugin-uglify": "^2.1.2",
    "rollup": "^2.61.1",
    "rollup-plugin-commonjs": "^10.1.0",
    "rollup-plugin-node-builtins": "^2.1.2",
    "rollup-plugin-node-globals": "^1.4.0",
    "rollup-plugin-node-resolve": "^5.2.0",

in our CI/CD pipeline, we execute the following npm script:

    "scripts:rollup": "rollup -c rollup.config.js",

And this is in our rollup config:

import commonjs from "rollup-plugin-commonjs";
import nodeResolve from "rollup-plugin-node-resolve";
import globals from "rollup-plugin-node-globals";
import builtins from "rollup-plugin-node-builtins";
import uglify from "@lopatnov/rollup-plugin-uglify";

export default [
  {
    input: "src/scripts/js/main.js",
    output: {
      file: "dist/js/main.min.js",
      format: "iife",
      name: "Main",
      sourcemap: true
    },
    plugins: [
      nodeResolve({ preferBuiltins: false }), // or `true`
      commonjs(),
      globals(),
      builtins(),
      uglify(),
    ],
  },
];

Expected behavior
We expect Rollup to build without issue

Screenshots
If applicable, add screenshots to help explain your problem.

  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
We're running this in Gitlab.

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.