opal-webpack-loader 0.11.2 → 0.13.0

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,4 +1,4 @@
1
- /* application stylesheets */
2
- body {
3
- color: black;
4
- }
1
+ /* application stylesheets */
2
+ body {
3
+ color: black;
4
+ }
@@ -1,150 +1,149 @@
1
- const path = require('path');
2
- const webpack = require('webpack');
3
- const OwlResolver = require('opal-webpack-loader/resolver'); // to resolve ruby files
4
- const ExtraWatchWebpackPlugin = require('extra-watch-webpack-plugin'); // to watch for added ruby files
5
-
6
- const common_config = {
7
- context: path.resolve(__dirname, '<%= opal_directory %>'),
8
- mode: "development",
9
- optimization: {
10
- removeAvailableModules: false,
11
- removeEmptyChunks: false,
12
- minimize: false // dont minimize for debugging
13
- },
14
- performance: {
15
- maxAssetSize: 20000000,
16
- maxEntrypointSize: 20000000
17
- },
18
- // use one of these below for source maps
19
- devtool: 'source-map', // this works well, good compromise between accuracy and performance
20
- // devtool: 'cheap-eval-source-map', // less accurate
21
- // devtool: 'inline-source-map', // slowest
22
- // devtool: 'inline-cheap-source-map',
23
- output: {
24
- // webpack-dev-server keeps the output in memory
25
- filename: '[name].js',
26
- path: path.resolve(__dirname, '<%= asset_output_directory %>'),
27
- publicPath: 'http://localhost:3035/assets/'
28
- },
29
- resolve: {
30
- plugins: [
31
- // this makes it possible for webpack to find ruby files
32
- new OwlResolver('resolve', 'resolved')
33
- ],
34
- alias: {
35
- 'react-dom': 'react-dom/profiling',
36
- 'schedule/tracing': 'schedule/tracing-profiling',
37
- }
38
- },
39
- plugins: [
40
- // both for hot reloading
41
- new webpack.NamedModulesPlugin(),
42
- new webpack.HotModuleReplacementPlugin(),
43
- // watch for added files in opal dir
44
- new ExtraWatchWebpackPlugin({ dirs: [ path.resolve(__dirname, '<%= opal_directory %>') ] })
45
- ],
46
- module: {
47
- rules: [
48
- {
49
- // loader for .scss files
50
- // test means "test for for file endings"
51
- test: /\.s[ac]ss$/,
52
- use: [
53
- { loader: "style-loader" },
54
- {
55
- loader: "css-loader",
56
- options: { sourceMap: true }
57
- },
58
- {
59
- loader: "sass-loader",
60
- options: {
61
- sassOptions: { includePaths: [path.resolve(__dirname, '<%= stylesheets_directory %>')] },
62
- sourceMap: true // set to false to speed up hot reloads
63
- }
64
- }
65
- ]
66
- },
67
- {
68
- // loader for .css files
69
- test: /\.css$/,
70
- use: [
71
- { loader: "style-loader" },
72
- {
73
- loader: "css-loader",
74
- options: { sourceMap: true }
75
- }
76
- ]
77
- },
78
- {
79
- test: /\.(png|svg|jpg|gif|woff|woff2|eot|ttf|otf)$/,
80
- use: [ "file-loader" ]
81
- },
82
- {
83
- // opal-webpack-loader will compile and include ruby files in the pack
84
- test: /(\.js)?\.rb$/,
85
- use: [
86
- {
87
- loader: 'opal-webpack-loader',
88
- options: {
89
- sourceMap: true,
90
- hmr: true,
91
- hmrHook: '<%= hmr_hook %>'
92
- }
93
- }
94
- ]
95
- }
96
- ]
97
- },
98
- // configuration for webpack-dev-server
99
- devServer: {
100
- <%= dev_server_before %>
101
- open: false,
102
- lazy: false,
103
- port: 3035,
104
- hot: true,
105
- // hotOnly: true,
106
- inline: true,
107
- https: false,
108
- disableHostCheck: true,
109
- headers: {
110
- "Access-Control-Allow-Origin": "*",
111
- "Access-Control-Allow-Methods": "GET, POST, PUT, DELETE, PATCH, OPTIONS",
112
- "Access-Control-Allow-Headers": "X-Requested-With, content-type, Authorization"
113
- },
114
- watchOptions: {
115
- // in case of problems with hot reloading uncomment the following two lines:
116
- // aggregateTimeout: 250,
117
- // poll: 50,
118
- ignored: /\bnode_modules\b/
119
- },
120
- contentBase: path.resolve(__dirname, 'public'),
121
- useLocalIp: false
122
- }
123
- };
124
-
125
- const browser_config = {
126
- target: 'web',
127
- entry: {
128
- application: [path.resolve(__dirname, '<%= js_entry %>')]
129
- }
130
- };
131
-
132
- const ssr_config = {
133
- target: 'node',
134
- entry: {
135
- application_ssr: [path.resolve(__dirname, '<%= js_ssr_entry %>')]
136
- }
137
- };
138
-
139
- const web_worker_config = {
140
- target: 'webworker',
141
- entry: {
142
- web_worker: [path.resolve(__dirname, '<%= js_web_worker_entry %>')]
143
- }
144
- };
145
-
146
- const browser = Object.assign({}, common_config, browser_config);
147
- const ssr = Object.assign({}, common_config, ssr_config);
148
- const web_worker = Object.assign({}, common_config, web_worker_config);
149
-
150
- module.exports = [ <%= default_targets %> ];
1
+ const path = require('path');
2
+ const webpack = require('webpack');
3
+ const OwlResolver = require('opal-webpack-loader/resolver'); // to resolve ruby files
4
+ const ExtraWatchWebpackPlugin = require('extra-watch-webpack-plugin'); // to watch for added ruby files
5
+
6
+ const common_config = {
7
+ context: path.resolve(__dirname, '<%= opal_directory %>'),
8
+ mode: "development",
9
+ optimization: {
10
+ moduleIds: 'named',
11
+ removeAvailableModules: false,
12
+ removeEmptyChunks: false,
13
+ minimize: false // dont minimize for debugging
14
+ },
15
+ performance: {
16
+ maxAssetSize: 20000000,
17
+ maxEntrypointSize: 20000000
18
+ },
19
+ // use one of these below for source maps
20
+ devtool: 'source-map', // this works well, good compromise between accuracy and performance
21
+ // devtool: 'cheap-eval-source-map', // less accurate
22
+ // devtool: 'inline-source-map', // slowest
23
+ // devtool: 'inline-cheap-source-map',
24
+ output: {
25
+ // webpack-dev-server keeps the output in memory
26
+ filename: '[name].js',
27
+ path: path.resolve(__dirname, '<%= asset_output_directory %>'),
28
+ publicPath: 'http://localhost:3035/assets/'
29
+ },
30
+ resolve: {
31
+ plugins: [
32
+ // this makes it possible for webpack to find ruby files
33
+ new OwlResolver('resolve', 'resolved')
34
+ ],
35
+ alias: {
36
+ 'react-dom': 'react-dom/profiling',
37
+ 'schedule/tracing': 'schedule/tracing-profiling',
38
+ }
39
+ },
40
+ plugins: [
41
+ // for hot reloading
42
+ new webpack.HotModuleReplacementPlugin(),
43
+ // watch for added files in opal dir
44
+ new ExtraWatchWebpackPlugin({ dirs: [ path.resolve(__dirname, '<%= opal_directory %>') ] })
45
+ ],
46
+ module: {
47
+ rules: [
48
+ {
49
+ // loader for .scss files
50
+ // test means "test for for file endings"
51
+ test: /\.s[ac]ss$/,
52
+ use: [
53
+ { loader: "style-loader" },
54
+ {
55
+ loader: "css-loader",
56
+ options: { sourceMap: true }
57
+ },
58
+ {
59
+ loader: "sass-loader",
60
+ options: {
61
+ sassOptions: { includePaths: [path.resolve(__dirname, '<%= stylesheets_directory %>')] },
62
+ sourceMap: true // set to false to speed up hot reloads
63
+ }
64
+ }
65
+ ]
66
+ },
67
+ {
68
+ // loader for .css files
69
+ test: /\.css$/,
70
+ use: [
71
+ { loader: "style-loader" },
72
+ {
73
+ loader: "css-loader",
74
+ options: { sourceMap: true }
75
+ }
76
+ ]
77
+ },
78
+ {
79
+ test: /\.(png|svg|jpg|gif|woff|woff2|eot|ttf|otf)$/,
80
+ use: [ "file-loader" ]
81
+ },
82
+ {
83
+ // opal-webpack-loader will compile and include ruby files in the pack
84
+ test: /(\.js)?\.rb$/,
85
+ use: [
86
+ {
87
+ loader: 'opal-webpack-loader',
88
+ options: {
89
+ sourceMap: true,
90
+ hmr: true,
91
+ hmrHook: '<%= hmr_hook %>'
92
+ }
93
+ }
94
+ ]
95
+ }
96
+ ]
97
+ },
98
+ // configuration for webpack-dev-server
99
+ devServer: {
100
+ <%= dev_server_before %>
101
+ open: false,
102
+ port: 3035,
103
+ hot: true,
104
+ https: false,
105
+ allowedHosts: 'all',
106
+ headers: {
107
+ "Access-Control-Allow-Origin": "*",
108
+ "Access-Control-Allow-Methods": "GET, POST, PUT, DELETE, PATCH, OPTIONS",
109
+ "Access-Control-Allow-Headers": "X-Requested-With, content-type, Authorization"
110
+ },
111
+ static: {
112
+ directory: path.resolve(__dirname, 'public'),
113
+ watch: {
114
+ // in case of problems with hot reloading uncomment the following two lines:
115
+ // aggregateTimeout: 250,
116
+ // poll: 50,
117
+ ignored: /\bnode_modules\b/
118
+ }
119
+ },
120
+ host: 'localhost'
121
+ }
122
+ };
123
+
124
+ const browser_config = {
125
+ target: 'web',
126
+ entry: {
127
+ application: [path.resolve(__dirname, '<%= js_entry %>')]
128
+ }
129
+ };
130
+
131
+ const ssr_config = {
132
+ target: 'node',
133
+ entry: {
134
+ application_ssr: [path.resolve(__dirname, '<%= js_ssr_entry %>')]
135
+ }
136
+ };
137
+
138
+ const web_worker_config = {
139
+ target: 'webworker',
140
+ entry: {
141
+ web_worker: [path.resolve(__dirname, '<%= js_web_worker_entry %>')]
142
+ }
143
+ };
144
+
145
+ const browser = Object.assign({}, common_config, browser_config);
146
+ const ssr = Object.assign({}, common_config, ssr_config);
147
+ const web_worker = Object.assign({}, common_config, web_worker_config);
148
+
149
+ module.exports = [ <%= default_targets %> ];
@@ -1,135 +1,134 @@
1
- const path = require('path');
2
- const webpack = require('webpack');
3
- const OwlResolver = require('opal-webpack-loader/resolver'); // to resolve ruby files
4
- const ExtraWatchWebpackPlugin = require('extra-watch-webpack-plugin'); // to watch for added ruby files
5
-
6
- const common_config = {
7
- context: path.resolve(__dirname, '<%= opal_directory %>'),
8
- mode: "development",
9
- optimization: {
10
- removeAvailableModules: false,
11
- removeEmptyChunks: false,
12
- minimize: false // dont minimize in development, to speed up hot reloads
13
- },
14
- performance: {
15
- maxAssetSize: 20000000,
16
- maxEntrypointSize: 20000000
17
- },
18
- output: {
19
- // webpack-dev-server keeps the output in memory
20
- filename: '[name].js',
21
- path: path.resolve(__dirname, '<%= asset_output_directory %>'),
22
- publicPath: 'http://localhost:3035/assets/'
23
- },
24
- resolve: {
25
- plugins: [
26
- // this makes it possible for webpack to find ruby files
27
- new OwlResolver('resolve', 'resolved')
28
- ]
29
- },
30
- plugins: [
31
- // both for hot reloading
32
- new webpack.NamedModulesPlugin(),
33
- new webpack.HotModuleReplacementPlugin(),
34
- // watch for added files in opal dir
35
- new ExtraWatchWebpackPlugin({ dirs: [ path.resolve(__dirname, '<%= opal_directory %>') ] })
36
- ],
37
- module: {
38
- rules: [
39
- {
40
- // loader for .scss files
41
- // test means "test for for file endings"
42
- test: /\.s[ac]ss$/,
43
- use: [
44
- { loader: "style-loader" },
45
- { loader: "css-loader" },
46
- {
47
- loader: "sass-loader",
48
- options: {
49
- sassOptions: { includePaths: [path.resolve(__dirname, '<%= stylesheets_directory %>')] },
50
- sourceMap: false
51
- }
52
- }
53
- ]
54
- },
55
- {
56
- // loader for .css files
57
- test: /\.css$/,
58
- use: [
59
- { loader: "style-loader" },
60
- { loader: "css-loader" }
61
- ]
62
- },
63
- {
64
- test: /\.(png|svg|jpg|gif|woff|woff2|eot|ttf|otf)$/,
65
- use: [ "file-loader" ]
66
- },
67
- {
68
- // opal-webpack-loader will compile and include ruby files in the pack
69
- test: /(\.js)?\.rb$/,
70
- use: [
71
- {
72
- loader: 'opal-webpack-loader',
73
- options: {
74
- sourceMap: false,
75
- hmr: true,
76
- hmrHook: '<%= hmr_hook %>'
77
- }
78
- }
79
- ]
80
- }
81
- ]
82
- },
83
- // configuration for webpack-dev-server
84
- devServer: {
85
- <%= dev_server_before %>
86
- open: false,
87
- lazy: false,
88
- port: 3035,
89
- hot: true,
90
- // hotOnly: true,
91
- inline: true,
92
- https: false,
93
- disableHostCheck: true,
94
- headers: {
95
- "Access-Control-Allow-Origin": "*",
96
- "Access-Control-Allow-Methods": "GET, POST, PUT, DELETE, PATCH, OPTIONS",
97
- "Access-Control-Allow-Headers": "X-Requested-With, content-type, Authorization"
98
- },
99
- watchOptions: {
100
- // in case of problems with hot reloading uncomment the following two lines:
101
- // aggregateTimeout: 250,
102
- // poll: 50,
103
- ignored: /\bnode_modules\b/
104
- },
105
- contentBase: path.resolve(__dirname, 'public'),
106
- useLocalIp: false
107
- }
108
- };
109
-
110
- const browser_config = {
111
- target: 'web',
112
- entry: {
113
- application: [path.resolve(__dirname, '<%= js_entry %>')]
114
- }
115
- };
116
-
117
- const ssr_config = {
118
- target: 'node',
119
- entry: {
120
- application_ssr: [path.resolve(__dirname, '<%= js_ssr_entry %>')]
121
- }
122
- };
123
-
124
- const web_worker_config = {
125
- target: 'webworker',
126
- entry: {
127
- web_worker: [path.resolve(__dirname, '<%= js_web_worker_entry %>')]
128
- }
129
- };
130
-
131
- const browser = Object.assign({}, common_config, browser_config);
132
- const ssr = Object.assign({}, common_config, ssr_config);
133
- const web_worker = Object.assign({}, common_config, web_worker_config);
134
-
135
- module.exports = [ <%= default_targets %> ];
1
+ const path = require('path');
2
+ const webpack = require('webpack');
3
+ const OwlResolver = require('opal-webpack-loader/resolver'); // to resolve ruby files
4
+ const ExtraWatchWebpackPlugin = require('extra-watch-webpack-plugin'); // to watch for added ruby files
5
+
6
+ const common_config = {
7
+ context: path.resolve(__dirname, '<%= opal_directory %>'),
8
+ mode: "development",
9
+ optimization: {
10
+ moduleIds: 'named',
11
+ removeAvailableModules: false,
12
+ removeEmptyChunks: false,
13
+ minimize: false // dont minimize in development, to speed up hot reloads
14
+ },
15
+ performance: {
16
+ maxAssetSize: 20000000,
17
+ maxEntrypointSize: 20000000
18
+ },
19
+ output: {
20
+ // webpack-dev-server keeps the output in memory
21
+ filename: '[name].js',
22
+ path: path.resolve(__dirname, '<%= asset_output_directory %>'),
23
+ publicPath: 'http://localhost:3035/assets/'
24
+ },
25
+ resolve: {
26
+ plugins: [
27
+ // this makes it possible for webpack to find ruby files
28
+ new OwlResolver('resolve', 'resolved')
29
+ ]
30
+ },
31
+ plugins: [
32
+ // for hot reloading
33
+ new webpack.HotModuleReplacementPlugin(),
34
+ // watch for added files in opal dir
35
+ new ExtraWatchWebpackPlugin({ dirs: [ path.resolve(__dirname, '<%= opal_directory %>') ] })
36
+ ],
37
+ module: {
38
+ rules: [
39
+ {
40
+ // loader for .scss files
41
+ // test means "test for for file endings"
42
+ test: /\.s[ac]ss$/,
43
+ use: [
44
+ { loader: "style-loader" },
45
+ { loader: "css-loader" },
46
+ {
47
+ loader: "sass-loader",
48
+ options: {
49
+ sassOptions: { includePaths: [path.resolve(__dirname, '<%= stylesheets_directory %>')] },
50
+ sourceMap: false
51
+ }
52
+ }
53
+ ]
54
+ },
55
+ {
56
+ // loader for .css files
57
+ test: /\.css$/,
58
+ use: [
59
+ { loader: "style-loader" },
60
+ { loader: "css-loader" }
61
+ ]
62
+ },
63
+ {
64
+ test: /\.(png|svg|jpg|gif|woff|woff2|eot|ttf|otf)$/,
65
+ use: [ "file-loader" ]
66
+ },
67
+ {
68
+ // opal-webpack-loader will compile and include ruby files in the pack
69
+ test: /(\.js)?\.rb$/,
70
+ use: [
71
+ {
72
+ loader: 'opal-webpack-loader',
73
+ options: {
74
+ sourceMap: false,
75
+ hmr: true,
76
+ hmrHook: '<%= hmr_hook %>'
77
+ }
78
+ }
79
+ ]
80
+ }
81
+ ]
82
+ },
83
+ // configuration for webpack-dev-server
84
+ devServer: {
85
+ <%= dev_server_before %>
86
+ open: false,
87
+ port: 3035,
88
+ hot: false,
89
+ https: false,
90
+ allowedHosts: 'all',
91
+ headers: {
92
+ "Access-Control-Allow-Origin": "*",
93
+ "Access-Control-Allow-Methods": "GET, POST, PUT, DELETE, PATCH, OPTIONS",
94
+ "Access-Control-Allow-Headers": "X-Requested-With, content-type, Authorization"
95
+ },
96
+ static: {
97
+ directory: path.resolve(__dirname, 'public'),
98
+ watch: {
99
+ // in case of problems with hot reloading uncomment the following two lines:
100
+ // aggregateTimeout: 250,
101
+ // poll: 50,
102
+ ignored: /\bnode_modules\b/
103
+ }
104
+ },
105
+ host: 'localhost'
106
+ }
107
+ };
108
+
109
+ const browser_config = {
110
+ target: 'web',
111
+ entry: {
112
+ application: [path.resolve(__dirname, '<%= js_entry %>')]
113
+ }
114
+ };
115
+
116
+ const ssr_config = {
117
+ target: 'node',
118
+ entry: {
119
+ application_ssr: [path.resolve(__dirname, '<%= js_ssr_entry %>')]
120
+ }
121
+ };
122
+
123
+ const web_worker_config = {
124
+ target: 'webworker',
125
+ entry: {
126
+ web_worker: [path.resolve(__dirname, '<%= js_web_worker_entry %>')]
127
+ }
128
+ };
129
+
130
+ const browser = Object.assign({}, common_config, browser_config);
131
+ const ssr = Object.assign({}, common_config, ssr_config);
132
+ const web_worker = Object.assign({}, common_config, web_worker_config);
133
+
134
+ module.exports = [ <%= default_targets %> ];