npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

lin3s-distribution

v4.3.2

Published

Distribution library for different purposes inside LIN3S

Downloads

6

Readme

LIN3S Distribution

Distribution library for different purposes inside LIN3S.

Latest Stable Version

Downloads from packagist (PHP): Downloads from Packagist

Downloads from NPM (JS): Downloads from NPM

Why?

In LIN3S, we are working with many libraries and projects and usually all of them need scripts to automate some process. This library centralize this kind of scripts and tasks improving its reusability.

Installation

At this moment, this package contains PHP and JavaScript code, so you can manage this library from NPM and from Composer.

If your project is in PHP, be sure that Composer is installed in your system and execute the following command:

$ composer require lin3s/distribution

Otherwise, if your project is in JavaScript, be sure that Node is installed in your system and execute the following command:

$ npm install lin3s-distribution --save-dev
#
# OR
#
$ yarn add lin3s-distribution --dev

Usage

The following code is the basic configuration to make it work with Webpack.

'use strict';

const Webpack = require('lin3s-distribution').Webpack;

const options = {
  entry: {
    'app': './app/Resources/assets/js/entry-app.js',
  },
  input: {
    base: 'app',
    scss: 'app/Resources/scss',
    includedNodeModules: [
      'swiper'
    ]
  },
  output: {
    jsPath: './web',
    jsPublicPath: '/',
    jsFilename: '[name].js',
    jsFilenameProduction: '[name].[chunkhash].js',

    cssPath: '',
    cssPublicPath: '/',
    cssFilename: '[name].css',
    cssFilenameProduction: '[name].[contenthash].css'
  },
  postcss: {
    autoprefixer: {
      browsers: ['last 2 versions']
    }
  },
  manifest: '../../manifest.json'
};

module.exports = Webpack(options);

Symfony integration

Firstly, you need to install the bundle in your app kernel.

// app/config/AppKernel.php

public function registerBundles()
{
    $bundles = [
        // ...

        new LIN3S\Distribution\Php\Symfony\Lin3sDistributionBundle(),
        // ...
    ];
}

Once the bundle has been enabled you can manage the configuration. The following is the default config:

# app/config/config.yml

lin3s_distribution:
    webpack:
        manifest_path: "%kernel.root_dir%/../manifest.json"
        public_js_path: "/js/"
        public_css_path: "/css/"

Optionally you can enable the webpack default configuration doing this:

# app/config/config.yml

lin3s_distribution:
    webpack: ~

Finally replace your script and link html tags with the following Twig tags.

{# app/Resources/views/base.html.twig #}

(...)

<head>
(...)

    {% webpack_entry_css 'app' %}
</head>

<body>
(...)

    {% webpack_entry_js 'app' %}
</body>

Licensing Options

License