Coder Social home page Coder Social logo

webpack-contrib / awesome-webpack Goto Github PK

View Code? Open in Web Editor NEW
4.6K 4.6K 354.0 1.13 MB

A curated list of awesome Webpack resources, libraries and tools

License: Creative Commons Zero v1.0 Universal

HTML 87.29% JavaScript 0.93% CSS 11.78%
awesome awesome-list documentation list webpack

awesome-webpack's People

Contributors

adrianleb avatar agoldis avatar amcdnl avatar andrewraycode avatar andywer avatar anikethsaha avatar apercu avatar arthurbergmz avatar ballercat avatar bebraw avatar bodaso avatar chrisvfritz avatar danburzo avatar darrenscerri avatar dhavalchaudhary avatar diegoleme avatar djforth avatar hipstersmoothie avatar isnifer avatar joshwiens avatar khalwat avatar kuncevic avatar myshov avatar ogonkov avatar ricardogobbosouza avatar rubenspgcavalcante avatar sargalias avatar slashgear avatar snitin315 avatar tienne avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

awesome-webpack's Issues

Create & style gh-pages

Because a README.md sucks to actually read :)

  • Custom template
  • Less annoying width
  • No need for the standard lib download stuff
  • TOC left of readable content as to not burn vertical space

Enhance Examples

  • List out common webpack examples
  • Troll the web for solid ( preferably framework agnostic ) webpack examples

Formatting - Rework URLs & Layout

  • Reference a single url for the SVG images
  • Tinker with using a div to properly align maintainer, github/twitter images & library stats

A Framework for WebPack

Hi,

Considering that creating webpack.config.js files can be troublesome for new comers and can quickly become unreadable, I created a small framework to handle this issue. This could be a first step toward a 0-config Webpack, just like what Parcel does.

I would like to know what are you thinking of this Framework, and if somebody could guide me if you think it could be interesting to merge it, e.g. into some documentations. I will be quite available Monday, and for 2 weeks, I'll push my Framework with its documentation into NPM Monday.

Thanks, in advance,

The principle of this Framework is quite simple :

const fs = require('fs');

const {BUILDERS} = require('....'); // we get some "builders"

// list your builds here.
module.exports = [
	// Build individual pages
	BUILDERS.WebPage(output_dir, input_dir),
	BUILDERS.WebPage(output_dir2, input_dir2),
];

And voilà, you have a full configuration to build web pages with HTML, JS, and CSS dependencies. Without the Framework, the corresponding Webpack configuration would be way too verbose.

You have other builders, for example to build a set of webpages :

const {BUILDERS, WebPage} = require('prehtml-loader');

module.exports = [
        // Build a website (a set of pages)
	...BUILDERS.WebSite(output_dir, input_dir, { // Pages
	       about: new WebPage('pages/about/'), // one page.
	       articles: WebPage.listWebPages(`${input_dir}/articles`) // several pages from a directory.
        }
];

Of course, we can easily modify the rules that are used :

const {BUILDERS, RULES} = require('prehtml-loader');

let rules = Object.assign({}, RULES); // get the default rules.

rules.js = function(config, {src, dst}) { // modify a rule.

        // a rule enable to modifies a standard WebPack configuration (i.e. you can add plugins, entries, module.rules, etc.).
	config.output.filename = `${dst}/index.js`;
	config.entry.push(`${src}/index.js`);
}

module.exports = [
	BUILDERS.WebPage('./dist/dev/page1', './src/page1', {rules} )
];

The objective is also to remove the rules from the Webpack config, enabling, for example, to reuse personalized rules across several projects (not implemented yet) :

const {BUILDERS, RULES_LOADER} = require('prehtml-loader');

let rules = RULES_LOADER('./src/webpack-rules'); // load project specific rules
// -- OR --
const {rules} = require('mylib'); // load rules from a npm package.

module.exports = [
	BUILDERS.WebPage('./dist/dev/page1', './src/page1', {rules} )
];

Of course, you can create your own builders or extends existing ones (it has to return a Wepack configuration) :

let MyBuilder = () => {
       let config = BUILDERS.WebPage('./dist/dev/page1', './src/page1' );
       config.plugins.push(....);
       return config;
}

let MyBuilder2 = () => {
     let rules = ....;

     let config = {
		module: {
			rules: [],
		},
		entry: [],
		output: {
			path: ROOT,
			publicPath: ''
		},
		plugins: []
	};

	for(let rule in rules)
		rules[rule](config, options);

	return config;
}

module.exports = [
      MyBuilder(),
      MyBuilder2()
];

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.