Timers and other features for Heroes of the Storm
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.

преди 4 години
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. 'use strict'
  2. const path = require('path')
  3. const config = require('../config')
  4. const ExtractTextPlugin = require('extract-text-webpack-plugin')
  5. exports.assetsPath = function (_path) {
  6. const assetsSubDirectory = process.env.NODE_ENV === 'production'
  7. ? config.build.assetsSubDirectory
  8. : config.dev.assetsSubDirectory
  9. return path.posix.join(assetsSubDirectory, _path)
  10. }
  11. exports.cssLoaders = function (options) {
  12. options = options || {}
  13. const cssLoader = {
  14. loader: 'css-loader',
  15. options: {
  16. minimize: process.env.NODE_ENV === 'production',
  17. sourceMap: options.sourceMap
  18. }
  19. }
  20. // generate loader string to be used with extract text plugin
  21. function generateLoaders (loader, loaderOptions) {
  22. const loaders = [cssLoader]
  23. if (loader) {
  24. loaders.push({
  25. loader: loader + '-loader',
  26. options: Object.assign({}, loaderOptions, {
  27. sourceMap: options.sourceMap
  28. })
  29. })
  30. }
  31. // Extract CSS when that option is specified
  32. // (which is the case during production build)
  33. if (options.extract) {
  34. return ExtractTextPlugin.extract({
  35. use: loaders,
  36. fallback: 'vue-style-loader'
  37. })
  38. } else {
  39. return ['vue-style-loader'].concat(loaders)
  40. }
  41. }
  42. // https://vue-loader.vuejs.org/en/configurations/extract-css.html
  43. return {
  44. css: generateLoaders(),
  45. postcss: generateLoaders(),
  46. less: generateLoaders('less'),
  47. sass: generateLoaders('sass', { indentedSyntax: true }),
  48. scss: generateLoaders('sass'),
  49. stylus: generateLoaders('stylus'),
  50. styl: generateLoaders('stylus')
  51. }
  52. }
  53. // Generate loaders for standalone style files (outside of .vue)
  54. exports.styleLoaders = function (options) {
  55. const output = []
  56. const loaders = exports.cssLoaders(options)
  57. for (const extension in loaders) {
  58. const loader = loaders[extension]
  59. output.push({
  60. test: new RegExp('\\.' + extension + '$'),
  61. use: loader
  62. })
  63. }
  64. return output
  65. }