|
1 |
| -import fs from 'fs'; |
2 |
| -import path from 'path'; |
3 |
| -import ExtractTextPlugin from 'extract-text-webpack-plugin'; |
| 1 | +import fs from "fs"; |
| 2 | +import path from "path"; |
| 3 | +import ExtractTextPlugin from "extract-text-webpack-plugin"; |
4 | 4 |
|
5 | 5 | export function readFileOrEmpty(path) {
|
6 | 6 | try {
|
7 |
| - return fs.readFileSync(path, 'utf-8'); |
| 7 | + return fs.readFileSync(path, "utf-8"); |
8 | 8 | } catch (e) {
|
9 |
| - return ''; |
| 9 | + return ""; |
10 | 10 | }
|
11 | 11 | }
|
12 | 12 |
|
13 | 13 | export const defaultConfig = {
|
14 |
| - entry: './index', |
| 14 | + entry: "./index", |
15 | 15 | module: {
|
16 | 16 | rules: [
|
17 | 17 | {
|
18 | 18 | test: /\.css$/,
|
19 | 19 | use: ExtractTextPlugin.extract({
|
20 |
| - fallback: { loader: 'style-loader' }, |
| 20 | + fallback: { loader: "style-loader" }, |
21 | 21 | use: {
|
22 |
| - loader: 'css-loader', |
23 |
| - options: { minimize: true } |
| 22 | + loader: "css-loader" |
24 | 23 | }
|
25 | 24 | })
|
26 |
| - }, |
27 |
| - ], |
| 25 | + } |
| 26 | + ] |
28 | 27 | },
|
29 | 28 | plugins: [],
|
30 | 29 | context: __dirname,
|
31 | 30 | output: {
|
32 |
| - filename: 'destination.js', |
33 |
| - path: path.resolve(__dirname, '../', 'js', 'default-exports') |
| 31 | + filename: "destination.js", |
| 32 | + path: path.resolve(__dirname, "../", "js", "default-exports") |
34 | 33 | }
|
35 | 34 | };
|
36 | 35 |
|
37 |
| -export function checkForWebpackErrors({err, stats, done}) { |
| 36 | +export function checkForWebpackErrors({ err, stats, done }) { |
38 | 37 | if (err) return done(err);
|
39 | 38 | if (stats.hasErrors()) return done(new Error(stats.toString()));
|
40 | 39 | }
|
0 commit comments