Commit Graph

36 Commits (9072ff93b91d0625673e2abd48bc8462befa3ae0)

Author SHA1 Message Date
Richard van der Hoff e868dbbb94 No need to make olm an external (#4139)
matrix-js-sdk now loads olm from global.Olm instead of requiring it
(https://github.com/matrix-org/matrix-js-sdk/pull/446), so we no longer need to
define it as an external.
2017-06-01 15:46:37 +01:00
Michael Telatynski 08fb20a0df use a character class for brevity
add a comment so this madness has meaning

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2017-04-22 14:02:18 +01:00
Michael Telatynski dd7f9e2d5f argh, fix eslint false positives
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2017-04-21 19:00:24 +01:00
Michael Telatynski 9b38a97110 Fix Webpack conf
+ conform to a bit more eslint (IDE makes my eyes hurt)
+ specify windows-specific copies of noParse regexes to stop the olm error

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2017-04-21 15:09:45 +01:00
David Baker f187a359e6 Add support for indexeddb sync in webworker 2017-04-06 11:15:14 +01:00
Richard van der Hoff b20f6ff8c1 Silence webpack dev server
Configure the dev server not to spew module lists all over the console.

(Arguably the fact our module list is so long that I have to do this is a bug,
but my life is too short)
2017-02-03 11:40:07 +00:00
Richard van der Hoff c3fa6ff805 Use the postcss-webpack-loader
Use postcss-webpack-loader instead of webpack-cli to process the scss. Doing so
mostly means that we avoid the problem that webpack-dev-server fails to start
if we haven't already built the CSS. (It also simplifies package.json somewhat,
which is no bad thing)
2017-01-19 02:48:17 +00:00
Matthew Hodgson 14eec6d982 Merge branch 'develop' into matthew/postcss 2017-01-18 12:44:42 +00:00
Matthew Hodgson 6c88201e23 use ye olde rel='alternate stylesheets' for theming 2017-01-17 19:14:16 +00:00
Richard van der Hoff 4a1b04e57b Add another layer of directory to webpack chunks 2017-01-17 12:00:20 +00:00
Richard van der Hoff b3bff92cc2 Put parent build hash in webpack output filenames
In order to better support a world where old build artifacts are available
(which is necessary to support bundle.js splitting), collect all the webpack
artifacts for the build into a single directory. Then we'll be able to clear
out old builds after a few weeks, knowing they won't be in use any more.
2017-01-16 18:01:25 +00:00
Matthew Hodgson 691fe611d6 experimental postcss 2017-01-10 11:06:09 +00:00
Matthew Hodgson bacb284415 basic jig for SASS-based themed CSS (one bundle per theme) 2016-12-28 02:01:28 +00:00
Richard van der Hoff 8be72e6c27 Configure olm memory size
16M is somewhat excessive: configure olm to use a bit less.

Requires changes to the olm library to do anything useful, but will be harmless
without them.

Partial fix to vector-im/riot-web#2726.
2016-12-14 11:59:37 +00:00
Richard van der Hoff 67c882648f Make sure we only pack one copy of react-dom (#2603)
Fixes https://github.com/vector-im/vector-web/issues/2601
2016-11-18 17:52:44 +00:00
David Baker 5b7f629996 Build to the 'webapp' directory instead
People may have config files in vector/ so it would be nonideal
if we started overwriting them / blowing them away.
2016-11-08 15:46:21 +00:00
David Baker 527c390152 Merge remote-tracking branch 'origin/develop' into dbkr/electron_3 2016-11-03 15:35:45 +00:00
Richard van der Hoff ff462580b0 Use webpack-dev-server instead of http-server
Advantages:
 * blocks while a rebuild is in progress so you're less likely to reload the
   old version

 * serves from memory rather than disk, so we no longer need to turn off the
   cachebuster to avoid filling the disk with bundles. Empirically, seems to
   last a plausible amount of time without OOMing; there's no real reason to
   believe it would use any more memory than webpack itself.

 * That in turn means we no longer need the hack to stop chrome caching old
   sourcemaps (because the sourcemap now has a cachebuster in its name).

 * one fewer process for parallelshell to (fail to) manage.

 * in future, we could consider the fancy hot-reload functionality.
2016-11-03 15:08:55 +00:00
David Baker caa3cb7d89 Electron support
From https://github.com/vector-im/vector-web/pull/2511 but with
just the actual electron changes
2016-11-02 18:49:28 +00:00
Richard van der Hoff a86f2720bc Avoid errors if olm is missing
If olm isn't installed, webpack prints out scary warnings (though it still
actually succeeds). Let's avoid scaring people by quietly removing it from the
list of things to process.
2016-10-27 10:16:10 +01:00
Richard van der Hoff 31ed719df1 webpack: Improve comment on HtmlWebpackPlugin 2016-10-26 16:52:26 +01:00
Richard van der Hoff 6396c60645 Put a cachebuster in the names of CSS and JS files
This means that clients can do better caching of assets, as it will mean we are
no longer reliant on etags to ensure that clients get a fresh version.

We inhibit the cachebuster for `npm start`, so that we don't get millions of
copies of the bundles on dev boxes.
2016-10-26 15:20:59 +01:00
Richard van der Hoff fcf683c8a7 Use webpack to copy olm.js
Rather than copying olm.js ourselves in package.json, get webpack to do it for
us by declaring it as a second entry point.
2016-10-26 14:29:21 +01:00
Richard van der Hoff 51b74251f9 Exclude olm from the webpack
Olm takes *ages* to webpack, and it doesn't compress well. So, serve it as a
separate asset to the browser.
2016-08-02 12:44:23 +01:00
Richard van der Hoff ef4b604caf webpack: always use the olm from vector-web
Fixes an error when matrix-js-sdk is symlinked into node_modules, which meant
that we would (try to) use the version of olm from js-sdk instead of
vector-web (https://github.com/vector-im/vector-web/issues/1765).
2016-07-12 23:10:53 +01:00
Richard van der Hoff 664f809362 webpack: Use `require` to look for olm
Since https://github.com/matrix-org/matrix-js-sdk/pull/141, the jenkins build
does pull in the olm module, but because it's using npm v2, buries it deep in
node_modules. Rather than using the `fs` module to hunt for it, just try to
`require` it in the webpack config.
2016-06-20 14:35:33 +01:00
Richard van der Hoff a0b460b084 Include react-addons-perf for non-production builds
This makes it possible to gather a few performance stats
2016-04-19 15:01:24 +01:00
Richard van der Hoff bf31d6d5fa Karma test tweaks
* Make sure we only get one js-sdk (and update runtime config to match)
* Don't verifyNoOutstandingRequests (since it is hard to be certain which we
  will get, and makes the tests too dependent on implementation-specifics).
* Disable color for npm test, to avoid confusing Jenkins
2016-04-13 17:41:23 +01:00
Richard van der Hoff c5c5e6d811 Tell webpack not to parse the highlight.js languages
Hopefully, this fixes https://github.com/vector-im/vector-web/issues/1046
without any side-effects.

It relies on the fact that the languages files are pretty simple - in
particular, they don't require any other modules. So we can tell webpack just
to suck them in as they are, rather than parsing them and causing an explosm.
2016-03-24 22:51:50 +00:00
Richard van der Hoff 97dd4e2e6b Merge branch 'develop' into rav/olm
Conflicts:
	webpack.config.js
2015-12-03 18:28:50 +00:00
Richard van der Hoff 782174069c Include olm in the webpack if it's been installed
.. to make it easy to build a crypto-enabled vector
2015-12-03 18:24:34 +00:00
David Baker 7ff5e42f3e Run the CSS through webpack so we can pull in CSS files from modules with require rather than symlinking into the node_module directory which is breaking people on different npm versions. 2015-12-01 18:05:43 +00:00
David Baker d66427ddde Relative-ize paths in webpack config: they're supposed to be relative but sometimes they aren't. 2015-10-23 10:16:00 +01:00
David Baker 4b904d90f2 Slightly improve source path tree in the browser debugger 2015-10-15 14:40:36 +01:00
David Baker 2adb8bac5c Actually turn on production mode: env vars need to be explicitly passed through 2015-10-14 09:20:18 +01:00
David Baker f020f4397c Switch to webpack
Webapck actually supports loading input source maps and generally seems a lot
more solid then browserify (even if their website has an annoying animated
logo).
2015-09-25 11:43:28 +01:00