Skip to content

Commit

Permalink
fix babelification problems
Browse files Browse the repository at this point in the history
  • Loading branch information
wheresrhys committed Jan 21, 2018
1 parent 8af8658 commit 0a8dfcc
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 41 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/test/fixtures/built-sw.js
/es5/
package-lock.json
/node_modules/
Expand Down
9 changes: 3 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
.PHONY: test

build-sw:
./node_modules/.bin/webpack --entry ./test/fixtures/sw.js --output-filename ./test/fixtures/built-sw.js

test-dev: build-sw
test-dev:
./node_modules/karma/bin/karma start --browsers=Chrome

test-chrome: build-sw
test-chrome:
./node_modules/karma/bin/karma start --single-run --browsers=Chrome

test-firefox: build-sw
test-firefox:
./node_modules/karma/bin/karma start --single-run --browsers=Firefox

test-unit:
Expand Down
13 changes: 6 additions & 7 deletions karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,32 +7,31 @@ module.exports = function(karma) {
frameworks: [ 'mocha', 'chai'],
files: [
'test/client.js',
'test/sw.js',
{pattern: 'test/fixtures/built-sw.js', served: true, included: false},
{pattern: 'test/fixtures/sw.js', served: true, included: false},
],
proxies: {
'/__sw.js': '/base/test/fixtures/built-sw.js'
'/__sw.js': '/base/test/fixtures/sw.js'
},
preprocessors: {
'test/**/*.js': ['webpack']
},
webpack: {
devtool: 'source-map',
// devtool: 'source-map',
module: {
rules: [
//babel
{
test: /\.js$/,
loader: 'babel-loader',
exclude: /node_modules/,
query: {
babelrc: false, // ignore any .babelrc in project & dependencies
cacheDirectory: true,
plugins: [
// ensures a module reqired multiple times is only transpiled once and
// is shared by all that use it rather than transpiling it each time
[require.resolve('babel-plugin-transform-runtime'),{
[require.resolve('babel-plugin-transform-runtime'), {
helpers: true,
polyfill: false,
polyfill: true,
}],
],
presets: [require.resolve('babel-preset-env')]
Expand Down
2 changes: 0 additions & 2 deletions src/client.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

const FetchMock = require('./lib/index');
const statusTextMap = require('./lib/status-text');
const theGlobal = typeof window !== 'undefined' ? window : self;
Expand Down
1 change: 0 additions & 1 deletion src/lib/compile-route.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
'use strict';
const glob = require('glob-to-regexp')
const express = require('path-to-regexp');
const URL = require('url');
Expand Down
24 changes: 0 additions & 24 deletions test/sw.js

This file was deleted.

0 comments on commit 0a8dfcc

Please sign in to comment.