opal-webpack-loader 0.12.0 → 0.13.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/lib/opal-webpack-loader/templates/application.css.erb +4 -4
- data/lib/opal-webpack-loader/templates/debug.js.erb +149 -149
- data/lib/opal-webpack-loader/templates/development.js.erb +134 -134
- data/lib/opal-webpack-loader/templates/opal_loader.rb.erb +7 -9
- data/lib/opal-webpack-loader/templates/opal_web_worker_loader.rb.erb +7 -9
- data/lib/opal-webpack-loader/templates/package.json.erb +25 -26
- data/lib/opal-webpack-loader/templates/production.js.erb +97 -99
- data/lib/opal-webpack-loader/version.rb +1 -1
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cc5914067754fe1f6d786cc52fa6b8dd4b108e1898ddb31427924bf60829296d
|
4
|
+
data.tar.gz: 7a9de1f8a01a248fb2d444b5445e6414fb6cb23d2dfef935265bb59f501c46dc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 63b4a676870b612482f63b59e1fc9d66ab068d2850cb7f9ba0fba72ca5a1daa47501275b8d2f6afc269d6862bee6778114e102b0c97760568448a2096b2eee1f
|
7
|
+
data.tar.gz: 43754aaa9a65903c7eb481a0909e9e36c5feab93d3060903960f5dc5299696ac6683715c61f7b83733bfda0116fc4dcb015c9a37422132be2cbf2cc39a5adaa1
|
data/README.md
CHANGED
@@ -38,8 +38,8 @@ Intel® Core™ i7-7700HQ CPU @ 2.80GHz × 8, with 8 workers in around 1850ms
|
|
38
38
|
### Requirements
|
39
39
|
- npm or yarn
|
40
40
|
- opal-webpack-loader consists of 2 parts, the npm package and the gem, both are required and must be the same version.
|
41
|
-
- webpack ^
|
42
|
-
- webpack-dev-server
|
41
|
+
- webpack ^5.50
|
42
|
+
- optional webpack-dev-server ^^4.0.0-rc.0 for development configurations
|
43
43
|
- the ES6 modules branch of opal
|
44
44
|
|
45
45
|
- [PR#2266](https://github.com/opal/opal/pull/2266),
|
@@ -1,4 +1,4 @@
|
|
1
|
-
/* application stylesheets */
|
2
|
-
body {
|
3
|
-
color: black;
|
4
|
-
}
|
1
|
+
/* application stylesheets */
|
2
|
+
body {
|
3
|
+
color: black;
|
4
|
+
}
|
@@ -1,149 +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
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
// devtool: '
|
22
|
-
// devtool: 'inline-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
'
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
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
|
-
|
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
|
+
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,134 +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
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
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
|
-
|
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 %> ];
|
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 %> ];
|
@@ -1,9 +1,7 @@
|
|
1
|
-
require 'opal'
|
2
|
-
|
3
|
-
# the gem opal-autoloader may be used, so its not necessary to use 'require' all the time,
|
4
|
-
# just using 'require_tree' to bundle everything is enough:
|
5
|
-
#
|
6
|
-
# require 'opal-autoloader'
|
7
|
-
# require_tree 'my_app' # for a sub directory 'my_app'
|
8
|
-
|
9
|
-
|
1
|
+
require 'opal'
|
2
|
+
|
3
|
+
# the gem opal-autoloader may be used, so its not necessary to use 'require' all the time,
|
4
|
+
# just using 'require_tree' to bundle everything is enough:
|
5
|
+
#
|
6
|
+
# require 'opal-autoloader'
|
7
|
+
# require_tree 'my_app' # for a sub directory 'my_app'
|
@@ -1,9 +1,7 @@
|
|
1
|
-
require 'opal'
|
2
|
-
|
3
|
-
# the gem opal-autoloader may be used, so its not necessary to use 'require' all the time,
|
4
|
-
# just using 'require_tree' to bundle everything is enough:
|
5
|
-
#
|
6
|
-
# require 'opal-autoloader'
|
7
|
-
# require_tree 'my_app' # for a sub directory 'my_app'
|
8
|
-
|
9
|
-
|
1
|
+
require 'opal'
|
2
|
+
|
3
|
+
# the gem opal-autoloader may be used, so its not necessary to use 'require' all the time,
|
4
|
+
# just using 'require_tree' to bundle everything is enough:
|
5
|
+
#
|
6
|
+
# require 'opal-autoloader'
|
7
|
+
# require_tree 'my_app' # for a sub directory 'my_app'
|
@@ -1,26 +1,25 @@
|
|
1
|
-
{
|
2
|
-
"private": true,
|
3
|
-
"dependencies": {
|
4
|
-
"opal-webpack-loader": "^<%= owl_version %>"
|
5
|
-
},
|
6
|
-
"scripts": {
|
7
|
-
"debug": "<%= debug_script %>",
|
8
|
-
"development": "<%= development_script %>",
|
9
|
-
"production_build": "<%= production_script %>"
|
10
|
-
},
|
11
|
-
"devDependencies": {
|
12
|
-
"compression-webpack-plugin": "^
|
13
|
-
"css-loader": "^
|
14
|
-
"extra-watch-webpack-plugin": "^1.0.3",
|
15
|
-
"file-loader": "^6.2.0",
|
16
|
-
"node-sass": "^6.0.
|
17
|
-
"parallel-webpack": "^2.6.0",
|
18
|
-
"sass-loader": "^
|
19
|
-
"style-loader": "^2.
|
20
|
-
"
|
21
|
-
"webpack": "^
|
22
|
-
"webpack-
|
23
|
-
"webpack-
|
24
|
-
|
25
|
-
|
26
|
-
}
|
1
|
+
{
|
2
|
+
"private": true,
|
3
|
+
"dependencies": {
|
4
|
+
"opal-webpack-loader": "^<%= owl_version %>"
|
5
|
+
},
|
6
|
+
"scripts": {
|
7
|
+
"debug": "<%= debug_script %>",
|
8
|
+
"development": "<%= development_script %>",
|
9
|
+
"production_build": "<%= production_script %>"
|
10
|
+
},
|
11
|
+
"devDependencies": {
|
12
|
+
"compression-webpack-plugin": "^8.0.1",
|
13
|
+
"css-loader": "^6.2.0",
|
14
|
+
"extra-watch-webpack-plugin": "^1.0.3",
|
15
|
+
"file-loader": "^6.2.0",
|
16
|
+
"node-sass": "^6.0.1",
|
17
|
+
"parallel-webpack": "^2.6.0",
|
18
|
+
"sass-loader": "^12.1.0",
|
19
|
+
"style-loader": "^3.2.1",
|
20
|
+
"webpack": "^5.50.0",
|
21
|
+
"webpack-assets-manifest": "^5.0.6",
|
22
|
+
"webpack-cli": "^4.7.2",
|
23
|
+
"webpack-dev-server": "^4.0.0-rc.0"
|
24
|
+
}
|
25
|
+
}
|
@@ -1,99 +1,97 @@
|
|
1
|
-
const path = require('path');
|
2
|
-
const OwlResolver = require('opal-webpack-loader/resolver');
|
3
|
-
const CompressionPlugin = require("compression-webpack-plugin"); // for gzipping the packs
|
4
|
-
const
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
};
|
94
|
-
|
95
|
-
const
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
module.exports = [ <%= default_targets %> ];
|
1
|
+
const path = require('path');
|
2
|
+
const OwlResolver = require('opal-webpack-loader/resolver');
|
3
|
+
const CompressionPlugin = require("compression-webpack-plugin"); // for gzipping the packs
|
4
|
+
const WebpackAssetsManifest = require('webpack-assets-manifest');
|
5
|
+
|
6
|
+
const common_config = {
|
7
|
+
context: path.resolve(__dirname, '<%= opal_directory %>'),
|
8
|
+
mode: "production",
|
9
|
+
optimization: {
|
10
|
+
minimize: true
|
11
|
+
},
|
12
|
+
performance: {
|
13
|
+
maxAssetSize: 20000000,
|
14
|
+
maxEntrypointSize: 20000000
|
15
|
+
},
|
16
|
+
output: {
|
17
|
+
filename: '[name]-[chunkhash].js', // include fingerprint in file name, so browsers get the latest
|
18
|
+
path: path.resolve(__dirname, '<%= asset_output_directory %>'),
|
19
|
+
publicPath: '/assets/'
|
20
|
+
},
|
21
|
+
resolve: {
|
22
|
+
plugins: [
|
23
|
+
new OwlResolver('resolve', 'resolved') // resolve ruby files
|
24
|
+
]
|
25
|
+
},
|
26
|
+
plugins: [
|
27
|
+
new CompressionPlugin({ test: /^((?!application_ssr).)*$/ }), // gzip compress, exclude application_ssr.js
|
28
|
+
new WebpackAssetsManifest({ publicPath: true, merge: true, output: 'manifest.json' }) // generate manifest
|
29
|
+
],
|
30
|
+
module: {
|
31
|
+
rules: [
|
32
|
+
{
|
33
|
+
test: /\.s[ac]ss$/,
|
34
|
+
use: [
|
35
|
+
{ loader: "style-loader" },
|
36
|
+
{
|
37
|
+
loader: "css-loader",
|
38
|
+
options: {
|
39
|
+
sourceMap: false, // set to false to speed up hot reloads
|
40
|
+
minimize: true // set to false to speed up hot reloads
|
41
|
+
}
|
42
|
+
},
|
43
|
+
{
|
44
|
+
loader: "sass-loader",
|
45
|
+
options: {
|
46
|
+
sassOptions: { includePath: [path.resolve(__dirname, '<%= stylesheets_directory %>')] },
|
47
|
+
sourceMap: false // set to false to speed up hot reloads
|
48
|
+
}
|
49
|
+
}
|
50
|
+
]
|
51
|
+
},
|
52
|
+
{
|
53
|
+
// loader for .css files
|
54
|
+
test: /\.css$/,
|
55
|
+
use: [ "style-loader", "css-loader" ]
|
56
|
+
},
|
57
|
+
{
|
58
|
+
test: /\.(png|svg|jpg|gif|woff|woff2|eot|ttf|otf)$/,
|
59
|
+
use: [ "file-loader" ]
|
60
|
+
},
|
61
|
+
{
|
62
|
+
// opal-webpack-loader will compile and include ruby files in the pack
|
63
|
+
test: /(\.js)?\.rb$/,
|
64
|
+
use: [
|
65
|
+
{
|
66
|
+
loader: 'opal-webpack-loader',
|
67
|
+
options: {
|
68
|
+
sourceMap: false,
|
69
|
+
hmr: false
|
70
|
+
}
|
71
|
+
}
|
72
|
+
]
|
73
|
+
}
|
74
|
+
]
|
75
|
+
}
|
76
|
+
};
|
77
|
+
|
78
|
+
const browser_config = {
|
79
|
+
target: 'web',
|
80
|
+
entry: { application: [path.resolve(__dirname, '<%= js_entry %>')] }
|
81
|
+
};
|
82
|
+
|
83
|
+
const ssr_config = {
|
84
|
+
target: 'node',
|
85
|
+
entry: { application_ssr: [path.resolve(__dirname, '<%= js_ssr_entry %>')] }
|
86
|
+
};
|
87
|
+
|
88
|
+
const web_worker_config = {
|
89
|
+
target: 'webworker',
|
90
|
+
entry: { web_worker: [path.resolve(__dirname, '<%= js_web_worker_entry %>')] }
|
91
|
+
};
|
92
|
+
|
93
|
+
const browser = Object.assign({}, common_config, browser_config);
|
94
|
+
const ssr = Object.assign({}, common_config, ssr_config);
|
95
|
+
const web_worker = Object.assign({}, common_config, web_worker_config);
|
96
|
+
|
97
|
+
module.exports = [ <%= default_targets %> ];
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: opal-webpack-loader
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.13.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jan Biedermann
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-08-
|
11
|
+
date: 2021-08-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: opal
|
@@ -56,16 +56,16 @@ dependencies:
|
|
56
56
|
name: oj
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - "
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 3.
|
61
|
+
version: 3.13.0
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- - "
|
66
|
+
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: 3.
|
68
|
+
version: 3.13.0
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: redis
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -184,14 +184,14 @@ dependencies:
|
|
184
184
|
requirements:
|
185
185
|
- - ">="
|
186
186
|
- !ruby/object:Gem::Version
|
187
|
-
version: 5.
|
187
|
+
version: 5.4.0
|
188
188
|
type: :development
|
189
189
|
prerelease: false
|
190
190
|
version_requirements: !ruby/object:Gem::Requirement
|
191
191
|
requirements:
|
192
192
|
- - ">="
|
193
193
|
- !ruby/object:Gem::Version
|
194
|
-
version: 5.
|
194
|
+
version: 5.4.0
|
195
195
|
description: "Bundle assets with webpack, resolve and compile opal ruby files\nand
|
196
196
|
import them in the bundle, without sprockets or the webpacker gem\n(but can be used
|
197
197
|
with both of them too). \nComes with a installer for rails and other frameworks.\n"
|