{ "info": { "author": "Armin Ronacher", "author_email": "armin.ronacher@active-4.com", "bugtrack_url": null, "classifiers": [ "Environment :: Plugins", "Environment :: Web Environment", "Framework :: Lektor", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License" ], "description": "# lektor-webpack-support\n\n[![Build Status](https://travis-ci.org/lektor/lektor-webpack-support.svg)](https://travis-ci.org/lektor/lektor-webpack-support) [![Code Coverage](https://codecov.io/gh/lektor/lektor-webpack-support/branch/master/graph/badge.svg)](https://codecov.io/gh/lektor/lektor-webpack-support)\n\nThis is a plugin for Lektor that adds support for webpack to projects. When\nenabled it can build a webpack project from the `webpack/` folder into the\nasset folder automatically when the server (or build process) is run with\nthe `-f webpack` flag.\n\n## Enabling the Plugin\n\nTo enable the plugin add this to your project file, run this command while\nsitting in your Lektor project directory:\n\n```bash\nlektor plugins add lektor-webpack-support\n```\n\n## Creating a Webpack Project\n\nNext you need to create a webpack project. Create a `webpack/` folder and\ninside that folder create `package.json` and a `webpack.config.js`\n\n### `webpack/package.json`\n\nThis file instructs `npm` which packages we will need. All we need for a\nstart is to create an almost empty file (name and version fields are mandatory\nbut not important for functionality, change them to suit your own needs):\n\n```json\n{\n \"name\": \"lektor-webpack\",\n \"version\": \"1.0.0\",\n \"private\": true\n}\n```\n\nNow we can `npm install` (or `yarn add`) the rest:\n\n```\n$ cd /webpack\n$ npm install --save-dev webpack babel-core node-sass babel-loader sass-loader css-loader url-loader style-loader file-loader extract-text-webpack-plugin\n```\n\nThis will install webpack itself together with babel and sass as well as\na bunch of loaders we need for getting all that configured. Because we\ncreated a `package.json` before and we use `--save-dev` the dependencies\nwill be remembered in the `package.json` file.\n\n### `webpack/webpack.config.js`\n\nNext up is the webpack config file. Here we will go with a very basic\nsetup that's good enough to cover most things you will encounter. The\nidea is to build the files from `webpack/scss` and `webpack/js` into\n`assets/static/gen` so that we can use it even if we do not have webpack\ninstalled for as long as someone else ran it before.\n\n```javascript\nvar webpack = require('webpack');\nvar path = require('path');\nvar ExtractTextPlugin = require('extract-text-webpack-plugin');\n\n\nvar options = {\n entry: {\n 'app': './js/main.js',\n 'styles': './scss/main.scss'\n },\n output: {\n path: path.dirname(__dirname) + '/assets/static/gen',\n filename: '[name].js'\n },\n devtool: '#cheap-module-source-map',\n resolve: {\n modulesDirectories: ['node_modules'],\n extensions: ['', '.js']\n },\n module: {\n loaders: [\n {\n test: /\\.js$/,\n exclude: /node_modules/,\n loader: 'babel-loader'\n },\n {\n test: /\\.scss$/,\n loader: ExtractTextPlugin.extract('style-loader', 'css-loader!sass-loader')\n },\n {\n test: /\\.css$/,\n loader: ExtractTextPlugin.extract('style-loader', 'css-loader')\n },\n {\n test: /\\.woff2?$|\\.ttf$|\\.eot$|\\.svg$|\\.png|\\.jpe?g\\|\\.gif$/,\n loader: 'file'\n }\n ]\n },\n plugins: [\n new ExtractTextPlugin('styles.css', {\n allChunks: true\n }),\n new webpack.optimize.UglifyJsPlugin(),\n new webpack.optimize.DedupePlugin()\n ]\n};\n\nmodule.exports = options;\n```\n\n## Creating the App\n\nNow we can start building our app. We configured at least two files\nin webpack: `js/main.js` and `scss/main.scss`. Those are the entry\npoints we need to have. You can create them as empty files in\n`webpack/js/main.js` and `webpack/scss/main.scss`.\n\n## Running the Server\n\nNow you're ready to go. When you run `lektor server` webpack will not\nrun, instead you need to now run it as `lektor server -f webpack` which\nwill enable the webpack build. Webpack automatically builds your files\ninto `assets/static/gen` and this is where Lektor will then pick up the\nfiles. This is done so that you can ship the webpack generated assets\nto others that do not have webpack installed which simplifies using a\nLektor website that uses webpack.\n\n## Manual Builds\n\nTo manually trigger a build that also invokes webpack you can use\n`lektor build -f webpack`.\n\n## Including The Files\n\nNow you need to include the files in your template. This will do it:\n\n```html\n\n\n```\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/lektor/lektor-webpack-support", "keywords": "Lektor plugin node webpack yarn scss static-site", "license": "BSD", "maintainer": "", "maintainer_email": "", "name": "lektor-webpack-support", "package_url": "https://pypi.org/project/lektor-webpack-support/", "platform": "", "project_url": "https://pypi.org/project/lektor-webpack-support/", "project_urls": { "Homepage": "http://github.com/lektor/lektor-webpack-support" }, "release_url": "https://pypi.org/project/lektor-webpack-support/0.5/", "requires_dist": [ "lektor; extra == 'test'", "pytest; extra == 'test'", "pytest-cov; extra == 'test'", "pytest-mock; extra == 'test'" ], "requires_python": "", "summary": "Super simple Lektor plugin that runs a webpack watcher", "version": "0.5" }, "last_serial": 3857122, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "e50d2d63c01bcb9bae075454dfc3a7fb", "sha256": "2f90b100502bc16043d359099544a49ee579c205472e60fd96e372c4911e5eff" }, "downloads": -1, "filename": "lektor_webpack_support-0.1-py2-none-any.whl", "has_sig": false, "md5_digest": "e50d2d63c01bcb9bae075454dfc3a7fb", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 3015, "upload_time": "2015-12-14T09:35:57", "url": "https://files.pythonhosted.org/packages/2b/25/b532ad2d34ffb2c48c53471539fdcb53f54b8cbf82e7bf942e4ec0b601ca/lektor_webpack_support-0.1-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "26c443b34a6a15842d412d22f5a3bc68", "sha256": "6a3d137fed19517b423922c0befe91b4e60bad65c006c70f37e5112e7ff87f17" }, "downloads": -1, "filename": "lektor-webpack-support-0.1.tar.gz", "has_sig": false, "md5_digest": "26c443b34a6a15842d412d22f5a3bc68", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3893, "upload_time": "2015-12-14T09:35:48", "url": "https://files.pythonhosted.org/packages/7f/2c/2c910db044ed36c0c2e79b51b52deb5b81078c25425bb2c98e6ecbcd29ca/lektor-webpack-support-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "b7890f9add8cb39e2197f1df6c6f3138", "sha256": "a413a824287862f5922e0935c6b7478e4d1662baa425789c51dd488ed0a2ec97" }, "downloads": -1, "filename": "lektor_webpack_support-0.2-py2.7.egg", "has_sig": false, "md5_digest": "b7890f9add8cb39e2197f1df6c6f3138", "packagetype": "bdist_egg", "python_version": "2.7", "requires_python": null, "size": 3388, "upload_time": "2016-12-01T22:09:48", "url": "https://files.pythonhosted.org/packages/67/a3/1c57497d17cd5d0c71f20c4c7027528ef236a00bc307ebcca3a3bb9d4b60/lektor_webpack_support-0.2-py2.7.egg" }, { "comment_text": "", "digests": { "md5": "92975270684d11ceebc347e6cec6e28d", "sha256": "9e3f5821042420b1eb0e44c4372eafe2e0f945fefcc27ec12d7da9c781949175" }, "downloads": -1, "filename": "lektor_webpack_support-0.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "92975270684d11ceebc347e6cec6e28d", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 3173, "upload_time": "2016-12-01T22:09:51", "url": "https://files.pythonhosted.org/packages/c7/23/6228e762c3180f86e28dc69f4d1bfbf8f96ddde92fa8ca2f0c6c18ae67fe/lektor_webpack_support-0.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5159e502decab6c9675c6501a0e9a2d8", "sha256": "7b3879bee2091d7f127f341b94b86eca7352591543f4a817cf8439ee319c17aa" }, "downloads": -1, "filename": "lektor-webpack-support-0.2.tar.gz", "has_sig": false, "md5_digest": "5159e502decab6c9675c6501a0e9a2d8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4176, "upload_time": "2016-12-01T22:09:46", "url": "https://files.pythonhosted.org/packages/72/c9/28e30486a703c4f049a790306e05b5a43d4a1a79694b30c37ba6abffc404/lektor-webpack-support-0.2.tar.gz" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "e36673d1be46b31479e75f8ce51783e4", "sha256": "096065145419442da1c62ed123bc9ec7207ab9844c11638c29e120a2bfc309f7" }, "downloads": -1, "filename": "lektor_webpack_support-0.3-py2.7.egg", "has_sig": false, "md5_digest": "e36673d1be46b31479e75f8ce51783e4", "packagetype": "bdist_egg", "python_version": "2.7", "requires_python": null, "size": 3429, "upload_time": "2016-12-01T22:47:58", "url": "https://files.pythonhosted.org/packages/8b/cc/ac976943633763dc7beba1bc08c9158fdfeb6c06091b50beadc00205273b/lektor_webpack_support-0.3-py2.7.egg" }, { "comment_text": "", "digests": { "md5": "62c8d043fd0ba494741bbac094dd2bfa", "sha256": "3c83d0e810ff719a4f7567282c29be671f5ac16fbf1fdc88588ff2956ad9f032" }, "downloads": -1, "filename": "lektor_webpack_support-0.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "62c8d043fd0ba494741bbac094dd2bfa", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 3190, "upload_time": "2016-12-01T22:48:00", "url": "https://files.pythonhosted.org/packages/47/84/c7322c3875744937e12bcd9baa44168b1c603dd38e73ecc66dc6a286b634/lektor_webpack_support-0.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "4acff4e8ba91da1e968147d6ea31df1d", "sha256": "24b9106136dbfbc7dbdc008a7fe99e0696fbdee480a1e46b0343b66bcd842d4f" }, "downloads": -1, "filename": "lektor-webpack-support-0.3.tar.gz", "has_sig": false, "md5_digest": "4acff4e8ba91da1e968147d6ea31df1d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4251, "upload_time": "2016-12-01T22:47:55", "url": "https://files.pythonhosted.org/packages/ea/ee/f21d05d3bd85dd900981f2b1bafefab75e45ce14f92b0460cb00756103a1/lektor-webpack-support-0.3.tar.gz" } ], "0.4": [ { "comment_text": "", "digests": { "md5": "2725e9fe280ab266b24702f8e15c5b60", "sha256": "6259573d4d601499da103386a0a3dfa659dc2a74aab58c9e07070c81e1b91b87" }, "downloads": -1, "filename": "lektor-webpack-support-0.4.tar.gz", "has_sig": false, "md5_digest": "2725e9fe280ab266b24702f8e15c5b60", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4490, "upload_time": "2018-03-01T23:43:11", "url": "https://files.pythonhosted.org/packages/29/14/77c92918f8f11ace9a06461a4c5a6a202a01478a7544b1ed2fdea7ae527b/lektor-webpack-support-0.4.tar.gz" } ], "0.4.1": [ { "comment_text": "", "digests": { "md5": "abe597c5010318d101b6e3c7a88404be", "sha256": "eb857307c1e9982e499217fd0b5c41289f0d35961b062ef052784ce4e473d8a8" }, "downloads": -1, "filename": "lektor_webpack_support-0.4.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "abe597c5010318d101b6e3c7a88404be", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 4477, "upload_time": "2018-05-08T21:19:38", "url": "https://files.pythonhosted.org/packages/ce/09/22e88d70d0a9492446667582e8cd90aff5c1cd4acc5f793c9bbe476f1464/lektor_webpack_support-0.4.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d9a9509aff48504cb6b221c2a1707ebb", "sha256": "34b96c0233ef39baecbe0f7da83951d3cc147db4b280762b499978833162483f" }, "downloads": -1, "filename": "lektor-webpack-support-0.4.1.tar.gz", "has_sig": false, "md5_digest": "d9a9509aff48504cb6b221c2a1707ebb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5343, "upload_time": "2018-05-08T21:19:37", "url": "https://files.pythonhosted.org/packages/c1/24/a977817b1c6bfb6d96ee1351b4ea9fab2257f1180266c834630deeae2ad8/lektor-webpack-support-0.4.1.tar.gz" } ], "0.5": [ { "comment_text": "", "digests": { "md5": "9459eae3b426a1c661a7b496773b11ed", "sha256": "02405921f5c4a93a71a111c762857f21df5d8c1a370e6b7ae81519773a545a09" }, "downloads": -1, "filename": "lektor_webpack_support-0.5-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "9459eae3b426a1c661a7b496773b11ed", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 4458, "upload_time": "2018-05-12T18:45:26", "url": "https://files.pythonhosted.org/packages/82/96/216db2b26af11c43cbe5c06732874c6e7cfb91aa3191344992d0d271199e/lektor_webpack_support-0.5-py2.py3-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "9459eae3b426a1c661a7b496773b11ed", "sha256": "02405921f5c4a93a71a111c762857f21df5d8c1a370e6b7ae81519773a545a09" }, "downloads": -1, "filename": "lektor_webpack_support-0.5-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "9459eae3b426a1c661a7b496773b11ed", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 4458, "upload_time": "2018-05-12T18:45:26", "url": "https://files.pythonhosted.org/packages/82/96/216db2b26af11c43cbe5c06732874c6e7cfb91aa3191344992d0d271199e/lektor_webpack_support-0.5-py2.py3-none-any.whl" } ] }