| 115 | }; |
| 116 | |
| 117 | const getBaseConfig = () => ({ |
| 118 | mode: isProd ? 'production' : 'development', |
| 119 | target: 'web', // required by live reloading |
| 120 | devtool: isProd ? false : 'inline-source-map', |
| 121 | output: { |
| 122 | path: resolve('dist'), |
| 123 | publicPath: '/', |
| 124 | filename: '[name].js', |
| 125 | hashFunction: 'xxhash64', |
| 126 | }, |
| 127 | node: { |
| 128 | global: false, |
| 129 | }, |
| 130 | performance: { |
| 131 | maxEntrypointSize: 1e6, |
| 132 | maxAssetSize: 0.5e6, |
| 133 | }, |
| 134 | resolve: { |
| 135 | alias, |
| 136 | extensions, |
| 137 | }, |
| 138 | module: { |
| 139 | rules: [ |
| 140 | // JS/TS |
| 141 | { |
| 142 | test: /\.m?[jt]sx?$/, |
| 143 | use: 'babel-loader', |
| 144 | exclude: file => /node_modules/.test(file) && !/vueleton|@vue[/\\]shared/.test(file), |
| 145 | }, |
| 146 | // CSS |
| 147 | { |
| 148 | oneOf: [ |
| 149 | // library CSS files: node_modules/**/*.css |
| 150 | styleRule(styleOptions, { |
| 151 | include: [nodeModules], |
| 152 | }), |
| 153 | // CSS modules: src/**/*.module.css |
| 154 | styleRule({ |
| 155 | ...styleOptions, |
| 156 | loaders: [postcssLoader], |
| 157 | modules: {}, |
| 158 | }, { |
| 159 | test: /\.module\.css$/, |
| 160 | }), |
| 161 | // normal CSS files: src/**/*.css |
| 162 | styleRule({ |
| 163 | ...styleOptions, |
| 164 | loaders: [postcssLoader], |
| 165 | }), |
| 166 | ], |
| 167 | }, |
| 168 | // SVG |
| 169 | { |
| 170 | test: /\.svg$/, |
| 171 | use: [{ |
| 172 | loader: 'svg-sprite-loader', |
| 173 | options: { |
| 174 | // extract: extractSVG, |