Skip to content
This repository has been archived by the owner. It is now read-only.
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

preact-script2

Preact component for insert <script> tag, inspired by vue-script2

version minified downloads Travis

Download

# NPM
npm install preact-script2

# Yarn
yarn add preact-script2

Usage

import Script2 from 'preact-script2';

export default class App extends Component {
  render() {
    return (
      <div>
        <Script2 src="/test.js" async type="some-type" integrity="1234567890" text="QWERTYUIOP" crossorigin="anonymous" />
        <Script2
          inlineScript="(function a() {console.warn('Hey, you just loading an inline script')})()" />
      </div>
    );
  }
}

Available Props

Props Name Type Note
src String -
async String -
type String -
integrity String -
text String -
crossorigin String -
inlineScript String -

Development

# NPM

# Running development
npm run dev
# Build demo apps
npm run build
# Build library for publish
npm run bundle

# Yarn

# Running development
yarn dev
# Build demo apps
yarn build
# Build library for publish
yarn bundle

Credit


Copyright © 2019 by Irfan Maulana

About

Preact component for insert <script> tag, inspired by vue-script2

Topics

Resources

License

Releases

No releases published

Packages

No packages published
You can’t perform that action at this time.