0.2.1 • Published 3 years ago

@zrlps/rollup-plugin-resolve v0.2.1

Weekly downloads
8
License
MIT
Repository
github
Last release
3 years ago

rollup-plugin-resolve

Resolve plugin for rollupjs.

Extended ES import grammer

  • Alias
  • Group
  • HOME and Root
  • Integration

Alias import

The file structure like this:

project
	rollup.config.js
	src
        util
        	...
		app
			main.js
// project/rollup.config.js
...
plugins: [
    resolve({
        alias: path.join(__dirname,"src")
    })
]
...
// project/src/app/main.js
import A from "@/util";

Group import

The file structure like this:

project
	util
		Async
			timeout.js export defalut () => {...}
			all.js export group(), some()
	main.js
// main.js
import { timeout, group, some } from "./util/Async";
import { Async } from "./util";
/*
	{
		timeout: ()=>{...},
		group: ()=>{...},
		some: ()=>{...},
	}
*/

HOME and Root import

// The ~ is alias of the HOME Environmental variable
import rand from "~/rand.js";
import math from "/lib/es/math";

Integration import

The file structure like this:

project/data/Animal
	Invertebrates
		CellularLevel.js export default {}
		TissueLevel.js export default {}
		OrganLevel
			Acoelomata
				Platyhelminthes
					TaeniaSolium.js export default {}
					Schistosoma.js export default {}
				Nematoda
					Pinworm.js export default {}
			Coelmata
				Annelida.js export default {}
				Arthropoda.js export default {}
				Mollusca.js export default {}
				Echinodermata.js export default {}
	Vertebrate.js export default {}
// rollup.config.js
{
	alias: path.join(__dirname,""),
}
import Animal from "{@/data/Animal}";
/*
	{
		Interebrates{
			CellularLevel: {},
			TissueLevel: {},
			OrganLevel: {
				Acoelomata: {
					Platyhelminthes: {
						TaeniaSolium: {},
						Schistosoma: {},
					}
					Nematoda: {
						Pinworm: {}
					}
				}
				Coelmata: {
					Annelida: {},
					Arthropoda: {},
					Mollusca: {},
					Echinodermata: {},
				}
			}
		}
		Vertebrate: {}
	}
*/
0.2.1

3 years ago

0.2.0

3 years ago

0.1.4

4 years ago

0.1.3

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago

0.0.8

5 years ago

0.0.7

5 years ago

0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago

1.0.0

5 years ago