Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
hypha
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ots
hypha
Commits
6d8dbbcb
Commit
6d8dbbcb
authored
3 years ago
by
Vikas
Browse files
Options
Downloads
Patches
Plain Diff
Add webpack static-dev config to use React app without webpack server
parent
6d10be9e
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
gulpfile.js
+2
-1
2 additions, 1 deletion
gulpfile.js
hypha/static_src/src/app/webpack.static.dev.config.js
+25
-0
25 additions, 0 deletions
hypha/static_src/src/app/webpack.static.dev.config.js
with
27 additions
and
1 deletion
gulpfile.js
+
2
−
1
View file @
6d8dbbcb
...
@@ -73,6 +73,7 @@ sass.compiler = require('sass');
...
@@ -73,6 +73,7 @@ sass.compiler = require('sass');
// Load webpack config
// Load webpack config
var
webpackDev
=
()
=>
require
(
options
.
theme
.
app
+
'
webpack.dev.config.js
'
);
var
webpackDev
=
()
=>
require
(
options
.
theme
.
app
+
'
webpack.dev.config.js
'
);
var
webpackStaticDev
=
()
=>
require
(
options
.
theme
.
app
+
'
webpack.static.dev.config.js
'
);
var
webpackProd
=
()
=>
require
(
options
.
theme
.
app
+
'
webpack.prod.config.js
'
);
var
webpackProd
=
()
=>
require
(
options
.
theme
.
app
+
'
webpack.prod.config.js
'
);
var
webpackAnalyze
=
()
=>
require
(
options
.
theme
.
app
+
'
webpack.analyze.config.js
'
);
var
webpackAnalyze
=
()
=>
require
(
options
.
theme
.
app
+
'
webpack.analyze.config.js
'
);
...
@@ -178,7 +179,7 @@ gulp.task('scripts:production', gulp.series('clean:js', function js () {
...
@@ -178,7 +179,7 @@ gulp.task('scripts:production', gulp.series('clean:js', function js () {
// Build App.
// Build App.
gulp
.
task
(
'
app
'
,
function
()
{
gulp
.
task
(
'
app
'
,
function
()
{
return
gulp
.
src
(
options
.
theme
.
app
+
'
src/
'
)
return
gulp
.
src
(
options
.
theme
.
app
+
'
src/
'
)
.
pipe
(
webpackStrm
(
webpackDev
()
))
.
pipe
(
webpackStrm
(
webpack
Static
Dev
()
))
.
pipe
(
gulp
.
dest
(
options
.
theme
.
app_dest
));
.
pipe
(
gulp
.
dest
(
options
.
theme
.
app_dest
));
})
})
...
...
This diff is collapsed.
Click to expand it.
hypha/static_src/src/app/webpack.static.dev.config.js
0 → 100644
+
25
−
0
View file @
6d8dbbcb
var
webpack
=
require
(
'
webpack
'
)
var
BundleTracker
=
require
(
'
webpack-bundle-tracker
'
)
var
config
=
require
(
'
./webpack.base.config.js
'
)
staticDevConfig
=
config
(
'
production
'
)
staticDevConfig
.
output
.
path
=
require
(
'
path
'
).
resolve
(
'
./assets/dist
'
)
staticDevConfig
.
plugins
=
staticDevConfig
.
plugins
.
concat
([
new
BundleTracker
({
filename
:
'
./hypha/static_compiled/app/webpack-stats.json
'
}),
new
webpack
.
EnvironmentPlugin
({
NODE_ENV
:
'
production
'
,
API_BASE_URL
:
null
,
}),
])
staticDevConfig
.
optimization
=
{}
/**
* A webpack config similar to production, but produces development-oriented webpack-stats file.
* This makes it possible to use React application without Webpack Dev Server.
*/
module
.
exports
=
staticDevConfig
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment