Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Ecolyo
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
Container Registry
Model registry
Operate
Environments
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
web-et-numerique
Factory
LLLE_Project
Ecolyo
Commits
25a943df
Commit
25a943df
authored
4 years ago
by
Yoan VALLET
Browse files
Options
Downloads
Patches
Plain Diff
feat: override config for dev environment
parent
514d1b76
No related branches found
No related tags found
3 merge requests
!103
Support
,
!102
Dev
,
!77
Feature/us172 update cozy scripts
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app.config.environment.dev.js
+54
-0
54 additions, 0 deletions
app.config.environment.dev.js
app.config.js
+2
-2
2 additions, 2 deletions
app.config.js
with
56 additions
and
2 deletions
app.config.environment.dev.js
0 → 100644
+
54
−
0
View file @
25a943df
'
use strict
'
const
webpack
=
require
(
'
webpack
'
)
const
merge
=
require
(
'
webpack-merge
'
)
const
{
useHotReload
,
devtool
}
=
require
(
'
./webpack.vars
'
)
let
plugins
=
[
new
webpack
.
DefinePlugin
({
__DEVELOPMENT__
:
true
,
}),
]
// In development, the bar and cozy-client-js are provided automatically. We use the ProvidePlugin
// since it allows us to use in production the cozy.bar and cozy.client declared by the <script />
// line injected by the stack, while in developement to have it "served" from
// our node_modules
const
stackProvidedLibsConfig
=
{
plugins
:
[
new
webpack
.
DefinePlugin
({
__STACK_ASSETS__
:
true
,
}),
],
module
:
{
rules
:
[
{
test
:
/cozy-bar
\/
dist
\/
cozy-bar
\.
min
\.
js$/
,
// Automatically import the CSS if the JS is imported.
// imports-loader@0.8.0 works but imports-loader@1.0.0 does not
loader
:
'
imports-loader?css=./cozy-bar.min.css
'
,
},
],
},
}
const
output
=
{}
if
(
useHotReload
)
{
plugins
=
plugins
.
concat
([
new
webpack
.
HotModuleReplacementPlugin
()])
output
.
globalObject
=
'
this
'
}
module
.
exports
=
merge
(
{
devtool
:
devtool
||
'
cheap-module-eval-source-map
'
,
mode
:
'
development
'
,
externals
:
[
'
cozy
'
],
plugins
,
output
,
optimization
:
{
removeAvailableModules
:
false
,
removeEmptyChunks
:
false
,
},
},
stackProvidedLibsConfig
)
This diff is collapsed.
Click to expand it.
app.config.js
+
2
−
2
View file @
25a943df
...
...
@@ -33,9 +33,9 @@ const configs = [
]
if
(
environment
===
'
production
'
)
{
configs
.
push
(
require
(
'
cozy-scripts/config/webpack
.environment.
prod
'
))
configs
.
push
(
require
(
'
./app.config
.environment.
dev
'
))
}
else
{
configs
.
push
(
require
(
'
cozy-scripts/config/webpack.environment.
dev
'
))
configs
.
push
(
require
(
'
cozy-scripts/config/webpack.environment.
prod
'
))
}
//module.exports = merge.apply(null, configs)
...
...
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