0.0.15 • Published 7 years ago

rgl-tplmin-loader v0.0.15

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

rgl-tplmin-loader

version  GitHub issues  Github licences

  • A webpack loader for regularjs 's component-template file.

  • Neither <script> nor <style> will be resolved or parsed or minified in this loader

  • Just only minify the tpl file's content-text in a simple way, remove redundant code(the special chars like space, enter between tags).

  • no parse, no render. It is different from regular-loader , just string convert

Installation

npm install --save-dev rgl-tplmin-loader

Usage

Use the loader either via your webpack config

Via webpack config (recommended)

webpack.config.js

module.exports = {
  module: {
    rules: [
      {
        test: /\.rgl$/, // or /\.html$/
        use: 'rgl-tplmin-loader'
      }
    ]
  }
}

with happypack

module.exports = {
  module: {
	rules: [
	  {
		test: /\.rgl$/, // or /\.html$/
		use: 'happypack/loader?id=rglmin'
	  }
	]
  }
},
plugins: [
	new HappyPack({
		id: 'rglmin',
		threadPool: happyThreadPool,
		loaders: ['rgl-tplmin-loader?' + JSON.stringify({
			minimize: true,
			comments: {
				html: false,
				rgl: false
			}
		})]
	})
]

In your application

import rgl from 'file.rgl';

CLI

webpack --module-bind 'rgl=rgl-tplmin'

In your application

import rgl from 'file.rgl';

Inline

In your application

import template from 'rgl-tplmin!./file.rgl';
0.0.15

7 years ago

0.0.14

7 years ago

0.0.13

7 years ago

0.0.12

7 years ago

0.0.11

7 years ago

0.0.10

7 years ago

0.0.9

7 years ago

0.0.7

7 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago