{"_id":"@afuggini/scripts-frontend","_rev":"7-9c4325787dd7caeab76acf94897efaf1","time":{"0.6.4":"2020-01-21T15:11:18.745Z","created":"2020-01-21T15:12:26.632Z","0.7.0-beta1":"2020-01-21T15:12:26.817Z","modified":"2022-04-04T11:52:51.770Z","0.7.0-beta2":"2020-01-21T15:14:46.439Z"},"name":"@afuggini/scripts-frontend","dist-tags":{"latest":"0.7.0-beta2"},"versions":{"0.7.0-beta1":{"name":"@afuggini/scripts-frontend","version":"0.7.0-beta1","description":"parse javascript with webpack","main":"dist/common.js","module":"dist/modular.js","repository":{"type":"git","url":"git+https://github.com/afuggini/pixel2html.git"},"author":{"name":"Miguel Palau","email":"mpalauzarza@gmail.com"},"license":"MIT","publishConfig":{"access":"public"},"bin":{"scripts-frontend":"cli.js"},"scripts":{"lint":"eslint 'src/**/*.js'","build":"rollup -c","prepare":"npm run build","dev":"rollup -c -w","prepublishOnly":"npm run build","postversion":"git push; git push --tags"},"dependencies":{"@babel/core":"^7.8.3","@babel/runtime":"^7.8.3","@afuggini/babel-preset":"^1.7.1","@pixel2html/eslint-config":"^1.7.0","babel-loader":"^8.0.6","eslint":"^6.8.0","eslint-loader":"^3.0.3","uglifyjs-webpack-plugin":"^2.2.0","webpack":"^4.41.5","webpack-bundle-analyzer":"^3.6.0"},"devDependencies":{"rollup":"^1.29.1"},"eslintConfig":{"extends":"@pixel2html/eslint-config","env":{"browser":true,"node":true,"mocha":true}},"bugs":{"url":"https://github.com/afuggini/pixel2html/issues"},"homepage":"https://github.com/afuggini/pixel2html#readme","_id":"@afuggini/scripts-frontend@0.7.0-beta1","_nodeVersion":"10.16.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-02rEpUuMpn9hb3cyyOdo12AbGegVQi3TTH89lmOtx/j2BJgKICjaWiJ3zM+fvCMrytSucBzxtDXBG+E0F/5u5g==","shasum":"9854d61bd24673f8b1611b3472db8480fd0e6a5f","tarball":"https://registry.npmjs.org/@afuggini/scripts-frontend/-/scripts-frontend-0.7.0-beta1.tgz","fileCount":6,"unpackedSize":23081,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeJxTbCRA9TVsSAnZWagAAkLUP/14SoYJft1wLK7gwg9vw\nv1Qz4V8YG+laN7cUmB1Urv4UDDPcx/FpQgzXsvB/Im6gW/+FBg0Ur2BYapdC\nE0j5Y72uh9KsB2zV3o8ECgsXNsGXkixoj2gE08X3ZdOQPrOq8DOmKcM86pm3\nzGh+tTIylzerEzLiXFG7gsaNjVx2NnxgN9atHe3OaI7DdSg06F1L7rUOwaLH\n1eDPNvyBA8du5Na4GSeg/zSO5Eb2cj3ckBVbd+yejehRCT+m967F0vuAq2OC\nvmtFw+qStubUlR1B4KmIN9eIss5VMx2TYPWUbNh74Z1jqV8cKu13aC5JaGW/\nW8a/mq24XDtedAigK+PhgCBcVbTkEpIYbvEFs9XRjEV2zDXxw492EUT5RqFp\npsCawG5yP5iK4eDGti2bKw+wWv0JoIPSW5dwty3hUltUcV2NJjJTMpsz/xO0\ndnKnOLp0b2l58XWV1eMFofXv9dDVYQuEQ3nDF7no29XuhPz1RMCyr+GICCp6\n4hS2IJ7cy2ey5MV88B5PQVcKNPVQfzXp1pJS93wVcqhfajZxUaW+7/ar1YAG\nQRlHNYtQNvwZBOvCSe//iBr4G3w3SBrRe3A0VUnMsw5xOWCV0+nlqfMMwTZj\nRya+DaUEDQBLQTPqfSdpXNBHdHWlghp1HxGanjNrw2SaqQIfkUayXiaX0Q6i\ncHrp\r\n=QZn+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBnHPoIuP/wCagEO574S1Vk4nslfZ2fBh9WsapWIB8vjAiAX2o/Z7L/Ub1u7wWP26Oz5p4m11qQ9ecBHVSWfeq46BQ=="}]},"maintainers":[{"name":"afuggini","email":"ariel@southernmedia.net"}],"_npmUser":{"name":"afuggini","email":"ariel@southernmedia.net"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/scripts-frontend_0.7.0-beta1_1579619546674_0.009690181922876961"},"_hasShrinkwrap":false},"0.7.0-beta2":{"name":"@afuggini/scripts-frontend","version":"0.7.0-beta2","description":"parse javascript with webpack","main":"dist/common.js","module":"dist/modular.js","repository":{"type":"git","url":"git+https://github.com/afuggini/pixel2html.git"},"author":{"name":"Miguel Palau","email":"mpalauzarza@gmail.com"},"license":"MIT","publishConfig":{"access":"public"},"bin":{"scripts-frontend":"cli.js"},"scripts":{"lint":"eslint 'src/**/*.js'","build":"rollup -c","prepare":"npm run build","dev":"rollup -c -w","prepublishOnly":"npm run build","postversion":"git push; git push --tags"},"dependencies":{"@babel/core":"^7.8.3","@babel/runtime":"^7.8.3","@afuggini/babel-preset":"^1.8.0-beta1","@pixel2html/eslint-config":"^1.7.0","babel-loader":"^8.0.6","eslint":"^6.8.0","eslint-loader":"^3.0.3","uglifyjs-webpack-plugin":"^2.2.0","webpack":"^4.41.5","webpack-bundle-analyzer":"^3.6.0"},"devDependencies":{"rollup":"^1.29.1"},"eslintConfig":{"extends":"@pixel2html/eslint-config","env":{"browser":true,"node":true,"mocha":true}},"bugs":{"url":"https://github.com/afuggini/pixel2html/issues"},"homepage":"https://github.com/afuggini/pixel2html#readme","_id":"@afuggini/scripts-frontend@0.7.0-beta2","_nodeVersion":"10.16.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-4xKTee8koV4kzhIFxXhkiVi0PBnE1+FTgaOOsritka6KrMlK3NZBYwsMHdWdR1avakgENTXdYf33UI5GzSHQYw==","shasum":"3c87a48fffaad166d7dd7ae5d21678435f07affe","tarball":"https://registry.npmjs.org/@afuggini/scripts-frontend/-/scripts-frontend-0.7.0-beta2.tgz","fileCount":6,"unpackedSize":23087,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeJxVmCRA9TVsSAnZWagAAQNYP/A8X1M3/uM8F7z6VnNoR\nI8fDzg5c2wfJ8UtHi7Ew7xSmBN9UMi4OcNEm86L2LkpUYhfBZn1ZW/aJZKwP\noYc2oytPW7Ie9+UapsBPeJULAoiqkSqRXuRibcXsFBuE5RDyOtBDT3nHvYku\nCCau5OWuLEjzbwS5uazXw3xY0CS6sVFk2lNwhu3QhX0znn8PBruTz2m8uI1T\nO4WAM5GIbPvi3D9940SylfAHqxQSHYs4mBqQHMSQMAbZEz2/yC1cbRuWo0L0\nUgzK5fSHp9SVsyBrAdcmav0kwryVJjCxsjrHjgOT+cGlT4uKulvuZ9CEOC+n\n7j6uH/C1Oeoxk9lwM0pY1FkIwp7f8EKXF8lUaYqpUu6uQ9OvQaevcVUEf31a\no7R8nMyf6eGRtxvY9eXlC6QPCzvpnIFGlkP7fYuJm8uvtwkFSnYCakDxOT/g\nfnq5oFFH9tDf4djVYYv5DBmD7wx4QkA+B7Z46dw7vu2DJ5n6SMUO98kdjxj2\nEd9pCU47Ho+so7g5GRLog4ngy9X1g+5yDikRQOm+lTK60lK6/hc+X8Qv+8Bj\n8gfvSxjiEIJU1kFv1226dYnYwVPQ6xkV6DNMal7TURC/0hK5jtGQ/e3o2R9S\n6eFCM9umXz/+1SHHK93mBPNu+OnqF+9yDYQ9LsLgmEzro6WiEqyvT1saljxn\ncbk2\r\n=M2yT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFm81HOWv+aGKUIdkE45y+gjduuNvzAnKq0ZF944F0voAiEA+7oe+e51fr4Nh0ovGqux1ff2zK5W4eiCKs/2hSFs3nw="}]},"maintainers":[{"name":"afuggini","email":"ariel@southernmedia.net"}],"_npmUser":{"name":"afuggini","email":"ariel@southernmedia.net"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/scripts-frontend_0.7.0-beta2_1579619686300_0.736326285067018"},"_hasShrinkwrap":false}},"maintainers":[{"name":"afuggini","email":"ariel@southernmedia.net"}],"description":"parse javascript with webpack","homepage":"https://github.com/afuggini/pixel2html#readme","repository":{"type":"git","url":"git+https://github.com/afuggini/pixel2html.git"},"author":{"name":"Miguel Palau","email":"mpalauzarza@gmail.com"},"bugs":{"url":"https://github.com/afuggini/pixel2html/issues"},"license":"MIT","readme":"# @afuggini/scripts-frontend\n\n[![npm version](https://badge.fury.io/js/%40afuggini%2Fscripts-frontend.svg)](https://badge.fury.io/js/%40afuggini%2Fscripts-frontend)\n[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)\n\nA highly shareable and customizable webpack config.\n\n## Features\n\n- Dynamic Imports (Code Splitting)\n- ES2017+\n- JSX\n- Linting via `@pixel2html/eslint-config`\n- Parsing all js (ours and vendor, vendor is cached though)\n- Sourcemaps for debugging\n- Tree-Shaking\n- Extend and customize the underlying config\n\n## Getting Started FAST!\n\n```sh\nnpm install --dev @afuggini/scripts-frontend\n```\n\n\n```sh\nnpx scripts-frontend development\n```\n\n:fire:\n\nWe have a set of opinions towards how the files should look like for it to be a zero-config situation.\n\n```\n# Your project root\n.\n├── dist\n│   └── assets\n│       └── js\n│           └── main.js # Compiled file\n└── src\n    └── assets\n        └── js\n            └── index.js # Your starting point\n```\n\nThat is to be compliant with the defaults we were using on our `generator-frontend` package, however this is easy to customize.\n\n## Frontend Generator\n\nIf you're using our [Frontend Generator](http://npm.im/@pixel2html/generator-frontend) or our [Shopify Generator](http://npm.im/@pixel2html/generator-shopify) then you don't have to to anything since they already use this package.\nBut if you're coming from scratch this is what you need to do:\n\n\n## Node\n\nCreate an `index.js` with the following:\n\n```js\nconst { compiler } = require('@afuggini/scripts-frontend')\n\n// Options are development, production or debug\nconst mode = 'development'\nconsole.log(`Compiling in ${mode} mode...`)\n\ncompiler(mode)\n  .then(() => console.log(`All done!!`))\n  .catch(e => console.log(e))\n```\n\nYou can now run `node index` to get your JS compiled.\n\n\n## Gulp\n\n```js\nconst gulp = require('gulp')\nconst { compiler } = require('@afuggini/scripts-frontend')\n\ngulp.task('start', () => compiler('development'))\ngulp.task('build', () => compiler('production'))\n\ngulp.task('default', gulp.series('start'))\n```\n\n## Customizing the underlying config\n\nTo customize your setup you need to create a `scripts.config.js` file at the root of your project that file will be a function that takes 2 parameters:\n\n- config (the default config) [See Webpack Config](https://webpack.js.org/configuration/)\n- webpack (a webpack instance so you can use plugins and whatever)\n\n\n`scripts.config.js`\n\n```js\nmodule.exports = function(config, webpack) {\n  // tweak away esketit\n\n  // Always return the config\n  return config\n}\n```\n\n## Shopify\n\nSince we do quite a bit of Shopify ourselves we added some opinionated list of shopify plugins which you can access like this:\n\n`scripts.config.js`\n\n```js\nconst { getShopifyPlugins } = require('@pixel2html/scripts-generator')\n\nmodule.exports = (config, webpack) => {\n  config.plugins = getShopifyPlugins()\n\n  // So the sourcemaps work on Shopify\n  config.output.filename = '[name].js.liquid'\n  return config\n}\n```\n\n## Shopify Generator\n\nWe also supplied a fully opinionated Shopify config which you can setup like this:\n\n`scripts.config.js`\n\n```js\nconst { createShopifyConfig } = require('@afuggini/scripts-frontend')\n\nmodule.exports = config => createShopifyConfig(config)\n```\n\n:fire:\n\nThis is compliant with the way our Shopify Generator works meaning your starting point is:\n\n`src/scripts/index.js`\n\nand the bundle outputs to:\n\n`.deploy/assets/main.js.liquid`\n\nWhile splitting vendor code from node_modules to:\n\n`.deploy/assets/vendor.js.liquid`\n\nThe liquid extension is used for sourcemaps support via Shopify Cache busting situation for assets.\n\nCheck the examples folder for some reasonable examples.\n\n## PRs Welcome!\n\nOpen an issue so we can discuss about it, then file a PR. :heart_eyes:\n","readmeFilename":"readme.md"}