helfy-create 0.0.3 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,81 +0,0 @@
1
- const path = require('path');
2
- const HTMLWebpackPlugin = require('html-webpack-plugin');
3
- const MiniCssExtractPlugin = require('mini-css-extract-plugin');
4
- const { CleanWebpackPlugin } = require('clean-webpack-plugin');
5
-
6
- const isDev = process.env.NODE_ENV === 'development';
7
-
8
- const paths = {
9
- src: path.resolve(__dirname, 'src'),
10
- dist: path.resolve(__dirname, 'dist'),
11
- context: path.relative(__dirname, 'src/context'),
12
- pages: path.resolve(__dirname, 'src/pages'),
13
- shared: path.resolve(__dirname, 'src/shared'),
14
- widgets: path.resolve(__dirname, 'src/widgets'),
15
- };
16
-
17
- module.exports = {
18
- context: paths.src,
19
- mode: isDev ? 'development' : 'production',
20
- entry: './index.ts',
21
- watchOptions: isDev
22
- ? { ignored: ['**/node_modules/**', '**/.helfy/**'] }
23
- : {},
24
- devServer: {
25
- hot: true,
26
- port: 3000,
27
- static: { directory: paths.src },
28
- compress: true,
29
- historyApiFallback: true,
30
- },
31
- output: {
32
- filename: 'bundle.js',
33
- path: paths.dist,
34
- publicPath: '/',
35
- },
36
- resolve: {
37
- modules: ['src', 'node_modules'],
38
- extensions: ['.ts', '.js', '.tsx', '.jsx', '.css'],
39
- alias: {
40
- '@': path.resolve(__dirname, 'src'),
41
- '@context': path.resolve(__dirname, 'src/context'),
42
- '@pages': path.resolve(__dirname, 'src/pages'),
43
- '@widgets': path.resolve(__dirname, 'src/widgets'),
44
- },
45
- },
46
- plugins: [
47
- new HTMLWebpackPlugin({
48
- template: './index.html',
49
- minify: !isDev ? { collapseWhitespace: true } : false,
50
- }),
51
- new CleanWebpackPlugin(),
52
- new MiniCssExtractPlugin({
53
- filename: `css/${isDev ? '[name]' : '[contenthash:8]_[id]'}.css`,
54
- ignoreOrder: true,
55
- }),
56
- ],
57
- module: {
58
- rules: [
59
- {
60
- test: /\.css$/,
61
- use: [
62
- MiniCssExtractPlugin.loader,
63
- { loader: 'css-loader', options: { importLoaders: 1 } },
64
- ],
65
- },
66
- {
67
- test: /\.tsx$/,
68
- exclude: /node_modules/,
69
- use: [
70
- 'babel-loader',
71
- require.resolve('@helfy/helfy/compiler/helfy-loader'),
72
- ],
73
- },
74
- {
75
- test: /\.(ts|js)$/,
76
- exclude: /node_modules/,
77
- use: 'babel-loader',
78
- },
79
- ],
80
- },
81
- };