Lightweight CSS Framework for Building Apps and Websites https://crispy-css.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

116 lines
4.7 KiB

4 years ago
6 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
5 years ago
6 years ago
  1. const mix = require('laravel-mix');
  2. const SvgSpritemapPlugin = require('svg-spritemap-webpack-plugin');
  3. const HtmlWebpackPlugin = require('html-webpack-plugin');
  4. const fs = require('fs');
  5. /*
  6. |--------------------------------------------------------------------------
  7. | Mix Asset Management
  8. |--------------------------------------------------------------------------
  9. |
  10. | Mix provides a clean, fluent API for defining some Webpack build steps
  11. | for your Laravel application. By default, we are compiling the Sass
  12. | file for your application, as well as bundling up your JS files.
  13. |
  14. */
  15. mix.webpackConfig({
  16. plugins: [
  17. new SvgSpritemapPlugin('assets/svg/*.svg', {
  18. output: {
  19. filename: 'dist/examples/symbol-defs.svg'
  20. },
  21. sprite: {
  22. prefix: 'icon-'
  23. }
  24. }),
  25. new HtmlWebpackPlugin({
  26. filename: 'dist/examples/index.html',
  27. template: 'src/html/index.html.ejs',
  28. title: 'Crispy CSS | Lightweight CSS Framework for Building Apps and Websites',
  29. description: 'Lightweight Framework for building fast and clean Websites and Apps for Mobile, Tablet and Desktop. Minimal UI-Elements, Functions and Helpers',
  30. footer: fs.readFileSync(__dirname + '/src/html/partials/footer.html'),
  31. inject: false
  32. }),
  33. new HtmlWebpackPlugin({
  34. filename: 'dist/examples/getting-started.html',
  35. template: 'src/html/page.html.ejs',
  36. title: 'Getting started!',
  37. body: fs.readFileSync(__dirname + '/src/html/partials/getting-started.html'),
  38. footer: fs.readFileSync(__dirname + '/src/html/partials/footer.html'),
  39. inject: false
  40. }),
  41. new HtmlWebpackPlugin({
  42. filename: 'dist/examples/core.html',
  43. template: 'src/html/page.html.ejs',
  44. title: 'Core',
  45. body: fs.readFileSync(__dirname + '/src/html/partials/core.html'),
  46. footer: fs.readFileSync(__dirname + '/src/html/partials/footer.html'),
  47. inject: false
  48. }),
  49. new HtmlWebpackPlugin({
  50. filename: 'dist/examples/components.html',
  51. template: 'src/html/page.html.ejs',
  52. title: 'Components',
  53. body: fs.readFileSync(__dirname + '/src/html/partials/components.html'),
  54. footer: fs.readFileSync(__dirname + '/src/html/partials/footer.html'),
  55. inject: false
  56. }),
  57. new HtmlWebpackPlugin({
  58. filename: 'dist/examples/helpers.html',
  59. template: 'src/html/page.html.ejs',
  60. title: 'Helpers',
  61. body: fs.readFileSync(__dirname + '/src/html/partials/helpers.html'),
  62. footer: fs.readFileSync(__dirname + '/src/html/partials/footer.html'),
  63. inject: false
  64. }),
  65. new HtmlWebpackPlugin({
  66. filename: 'dist/examples/mixins.html',
  67. template: 'src/html/page.html.ejs',
  68. title: 'Mixins',
  69. body: fs.readFileSync(__dirname + '/src/html/partials/mixins.html'),
  70. footer: fs.readFileSync(__dirname + '/src/html/partials/footer.html'),
  71. inject: false
  72. }),
  73. new HtmlWebpackPlugin({
  74. filename: 'dist/examples/functions.html',
  75. template: 'src/html/page.html.ejs',
  76. title: 'Functions',
  77. body: fs.readFileSync(__dirname + '/src/html/partials/functions.html'),
  78. footer: fs.readFileSync(__dirname + '/src/html/partials/footer.html'),
  79. inject: false
  80. }),
  81. new HtmlWebpackPlugin({
  82. filename: 'dist/examples/imprint.html',
  83. template: 'src/html/page.html.ejs',
  84. title: 'Imprint',
  85. body: fs.readFileSync(__dirname + '/src/html/partials/imprint.html'),
  86. footer: fs.readFileSync(__dirname + '/src/html/partials/footer.html'),
  87. inject: false
  88. }),
  89. new HtmlWebpackPlugin({
  90. filename: 'dist/examples/privacy-policy.html',
  91. template: 'src/html/page.html.ejs',
  92. title: 'Privacy Policy',
  93. body: fs.readFileSync(__dirname + '/src/html/partials/privacy-policy.html'),
  94. footer: fs.readFileSync(__dirname + '/src/html/partials/footer.html'),
  95. inject: false
  96. })
  97. ]
  98. });
  99. mix.sass('src/crispy-all.scss', 'dist/crispy-all.css')
  100. .sass('src/crispy-minimal.scss', 'dist/crispy-minimal.css')
  101. .sass('src/examples/styles.scss', 'dist/examples/styles.css', {
  102. sassOptions: {
  103. includePaths: [
  104. 'node_modules/reflex-grid/scss'
  105. ]
  106. }
  107. })
  108. .options({
  109. postCss: [
  110. require('postcss-css-variables')()
  111. ]
  112. });