Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
purescript-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
142
Issues
142
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gargantext
purescript-gargantext
Commits
3ac42c25
Commit
3ac42c25
authored
Jan 20, 2020
by
James Laver
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'update-webpack-tooling' into 'dev'
simplify webpack setup See merge request
!24
parents
d05bc38b
5fb755d4
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
22 additions
and
55 deletions
+22
-55
package.json
package.json
+1
-0
Array.js
src/Gargantext/Utils/Array.js
+4
-4
Regex.js
src/Gargantext/Utils/Regex.js
+12
-8
index.js
src/index.js
+1
-1
webpack.config.js
webpack.config.js
+4
-42
No files found.
package.json
View file @
3ac42c25
...
...
@@ -4,6 +4,7 @@
"rebuild-set"
:
"spago psc-package-insdhall"
,
"install-ps"
:
"psc-package install"
,
"compile"
:
"pulp --psc-package build"
,
"prebuild"
:
"yarn compile"
,
"build"
:
"pulp --psc-package browserify -t dist/bundle.js"
,
"sass"
:
"sass dist/styles/"
,
"predev"
:
"yarn prestart"
,
...
...
src/Gargantext/Utils/Array.js
View file @
3ac42c25
function
_push
(
a
,
i
)
{
a
.
push
(
i
);
}
module
.
exports
=
{
_push
:
_push
}
;
function
_push
(
a
,
i
)
{
a
.
push
(
i
);
}
exports
.
_push
=
_push
;
src/Gargantext/Utils/Regex.js
View file @
3ac42c25
function
_cloneRegex
(
r
)
{
return
new
RegExp
(
r
.
source
,
r
.
flags
);
}
function
_getRegexLastIndex
(
r
)
{
return
r
.
lastIndex
;
}
function
_execRegex
(
r
,
s
)
{
return
r
.
exec
(
s
);
}
module
.
exports
=
{
_cloneRegex
:
_cloneRegex
,
_getRegexLastIndex
:
_getRegexLastIndex
,
_execRegex
:
_execRegex
};
function
_cloneRegex
(
r
)
{
return
new
RegExp
(
r
.
source
,
r
.
flags
);
}
function
_getRegexLastIndex
(
r
)
{
return
r
.
lastIndex
;
}
function
_execRegex
(
r
,
s
)
{
return
r
.
exec
(
s
);
}
exports
.
_cloneRegex
=
_cloneRegex
;
exports
.
_getRegexLastIndex
=
_getRegexLastIndex
;
exports
.
_execRegex
=
_execRegex
;
src/index.js
View file @
3ac42c25
// This file is just a wrapper so that webpack will call our main function
require
(
'.
/Main.purs
'
).
main
();
require
(
'.
./output/Main
'
).
main
();
webpack.config.js
View file @
3ac42c25
...
...
@@ -8,33 +8,11 @@ let HtmlWebpackPlugin = require('html-webpack-plugin');
let
CleanWebpackPlugin
=
require
(
'clean-webpack-plugin'
);
let
isWatch
=
process
.
argv
.
some
(
a
=>
a
===
'--watch'
);
// TODO: We have agreed to move to spago, but not done it yet
// let spago_sources = async () =>
// exec.quiet(
// "psc-package sources",
// { options: 'strict' }
// ).then(function (res) {
// let sources = res.stdout.split(/\r?\n/);
// sources.pop(); // extra newline at the end of output
// return sources;
// });
let
dist
=
path
.
join
(
__dirname
,
'dist'
);
let
src
=
path
.
join
(
__dirname
,
'src'
);
let
test
=
path
.
join
(
__dirname
,
'test'
);
// kill when spago
let
futured
=
async
()
=>
new
Promise
((
resolve
,
_
)
=>
resolve
([]));
module
.
exports
=
(
env
)
=>
// spago_sources()
futured
()
.
then
(
function
(
ps_sources
)
{
ps_sources
.
push
(
'src/**/*.purs'
);
// TODO: testing in browser and headless
// if (env === "browser" || env === "headless")
// ps_sources.push('test/Main.purs');
module
.
exports
=
(
env
)
=>
{
let
config
=
{
cache
:
true
,
mode
:
'development'
,
...
...
@@ -52,22 +30,6 @@ module.exports = (env) =>
},
module
:
{
rules
:
[
{
test
:
/
\.
purs$/
,
exclude
:
/
(
node_modules
)
/
,
use
:
[
{
loader
:
"purs-loader"
,
options
:
{
src
:
ps_sources
,
output
:
dist
,
pscIde
:
true
,
pscIdeClientArgs
:
{
port
:
4002
},
pscIdeServerArgs
:
{
port
:
4002
},
pscArgs
:
{
codegen
:
"js,sourcemaps"
},
pscPackage
:
true
,
bundle
:
false
,
watch
:
isWatch
}},
{
loader
:
"source-map-loader"
},
]},
{
test
:
/
\.
css$/
,
exclude
:
/
(
node_modules
)
/
,
use
:
[
"style-loader"
,
"css-loader"
]},
...
...
@@ -75,13 +37,13 @@ module.exports = (env) =>
exclude
:
/
(
node_modules
)
/
,
use
:
[
"file-loader"
]},
{
test
:
/
\.
js$/
,
exclude
:
/
(
node_modules
)
/
,
exclude
:
[
/
(
node_modules
)
/
,
/
(
output
)
/
]
,
use
:
[
"babel-loader"
,
"source-map-loader"
]}
]
},
resolve
:
{
modules
:
[
'node_modules'
],
extensions
:
[
'.
purs'
,
'.
js'
]
extensions
:
[
'.js'
]
},
plugins
:
[
// TODO: can we put the checked-in assets in dist somewhere else
...
...
@@ -110,4 +72,4 @@ module.exports = (env) =>
console
.
log
(
"unknown env: "
,
env
);
}
return
config
;
}
)
;
};
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment