@juandinella/penny-scripts
parse javascript with webpack
Last updated 4 months ago by juandinella .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @juandinella/penny-scripts 
SYNC missed versions from official npm registry.

@juandinella/penny-scripts

npm version JavaScript Style Guide

A highly shareable and customizable webpack config.

Features

  • Dynamic Imports (Code Splitting)
  • ES2017+
  • JSX
  • Linting via @juandinella/eslint-config
  • Parsing all js (ours and vendor, vendor is cached though)
  • Sourcemaps for debugging
  • Tree-Shaking
  • Extend and customize the underlying config

Getting Started FAST!

npm install --dev @juandinella/penny-scripts
npx penny-scripts development

:fire:

We have a set of opinions towards how the files should look like for it to be a zero-config situation.

# Your project root
.
├── dist
│   └── assets
│       └── js
│           └── main.js # Compiled file
└── src
    └── assets
        └── js
            └── index.js # Your starting point

That is to be compliant with the defaults we were using on our generator-frontend package, however this is easy to customize.

Node

Create an index.js with the following:

const { compiler } = require("@juandinella/penny-scripts");

// Options are development, production or debug
const mode = "development";
console.log(`Compiling in ${mode} mode...`);

compiler(mode)
  .then(() => console.log(`All done!!`))
  .catch(e => console.log(e));

You can now run node index to get your JS compiled.

Gulp

const gulp = require("gulp");
const { compiler } = require("@juandinella/penny-scripts");

gulp.task("start", () => compiler("development"));
gulp.task("build", () => compiler("production"));

gulp.task("default", gulp.series("start"));

Customizing the underlying config

To customize your setup you need to create a scripts.config.js file at the root of your project that file will be a function that takes 2 parameters:

  • config (the default config) See Webpack Config
  • webpack (a webpack instance so you can use plugins and whatever)

scripts.config.js

module.exports = function(config, webpack) {
  // tweak away esketit

  // Always return the config
  return config;
};

Current Tags

  • 1.3.3                                ...           latest (4 months ago)

22 Versions

  • 1.3.3                                ...           4 months ago
  • 1.3.1                                ...           4 months ago
  • 1.3.0                                ...           4 months ago
  • 1.2.9                                ...           4 months ago
  • 1.2.8                                ...           4 months ago
  • 1.2.7                                ...           4 months ago
  • 1.2.5                                ...           4 months ago
  • 1.2.4                                ...           4 months ago
  • 1.2.3                                ...           5 months ago
  • 1.2.1                                ...           5 months ago
  • 1.2.0                                ...           5 months ago
  • 1.1.9                                ...           5 months ago
  • 1.1.8                                ...           5 months ago
  • 1.1.7                                ...           5 months ago
  • 1.1.6                                ...           5 months ago
  • 1.1.5                                ...           5 months ago
  • 1.1.4                                ...           5 months ago
  • 1.1.3                                ...           5 months ago
  • 1.1.2                                ...           5 months ago
  • 1.1.1                                ...           5 months ago
  • 1.1.0                                ...           5 months ago
  • 1.0.0                                ...           5 months ago
Maintainers (1)
Downloads
Today 22
This Week 22
This Month 22
Last Day 0
Last Week 0
Last Month 0
Dev Dependencies (1)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |