A JS heleper library. Docs following soon
npm install @kizmann/pico-js [or] yarn add @kizmann/pico-js
This package is dependent of moment (Right now its required but will be optional or ditched soon).
<script src="//unpkg.com/@kizmann/pico-js@latest/dist/pico-js.js"></script>
pi.Dom.ready(function () {
console.log('Yeah :clap:');
});
import { Dom } from "@kizmann/pico-js";
Dom.ready(function () {
console.log('Yeah :metal:');
});
Incase you are not using the babel plugins (ES6) used in babel.config.js you will encounter errors while compiling. To prevent that its required to add an alias to your webpack.config.js.
module.exports = {
resolve: {
alias: {
'@kizmann/pico-js': '@kizmann/pico-js/dist/pico-js.js'
}
}
}
mix.webpackConfig({
resolve: {
alias: {
'@kizmann/pico-js': '@kizmann/pico-js/dist/pico-js.js'
}
}
});
When using VS Code with the ES5 fix from above you need to create or add to your existsing jsconfig.json this alias to enable correct autocomplete.
{
"compilerOptions": {
"paths": {
"@kizmann/pico-js": ["node_modules/@kizmann/pico-js/src/index.js"]
}
}
}