Sign inSign up

miroff/npm-uglify

By miroff

•Updated about 2 years ago

Image
Developer tools
0

952

miroff/npm-uglify repository overview

⁠JavaScript and CSS uglify for PHP Storm

Add new service in your docker-compose.yaml

    npm:
        image: miroff/npm-uglify:latest
        working_dir: /app
        volumes:
            - .:/app
        command: tail -f /dev/null

⁠Create files in the root of the project directory

Create dc_js

#!/usr/bin/env bash
docker-compose exec -T -- npm terser "$@"

Create dc_sass

#!/usr/bin/env bash
docker-compose exec -T -- npm sass "$@"

Don't forget to make them executable

chmod +x bin/*

⁠PHPStorm:FileWatchers Configuration

⁠SASS

and in PhpStorm:

Programm:

PROJECT_ROOT_DIRECTORY/bin/dc_sass

Arguments:

--update /app/$FileRelativeDir$/$FileName$:/app/$FileRelativeDir$/$FileNameWithoutAllExtensions$.min.css --style compressed
⁠UglifyJS

and in PhpStorm:

Programm:

PROJECT_ROOT_DIRECTORY/bin/dc_js

Arguments:

/app/$FileRelativeDir$/$FileName$ -o /app/$FileRelativeDir$/$FileNameWithoutExtension$.min.js -c --mangle --source-map

Tag summary

Content type

Image

Digest

sha256:7ae488fc7…

Size

602.7 MB

Last updated

about 2 years ago

docker pull miroff/npm-uglify