Skip to content

Commit 6421818

Browse files
committed
don't pass frontend build files through babel
since we're on node 6.6 now, we don't need babel for anything we were using it for in our frontend build/webpack code that runs on node. (except for es6 import/export) Change-Id: I41352fdc8adb06fe1585565f63d808d249f92864 Reviewed-on: https://gerrit.instructure.com/91573 Reviewed-by: Simon Williams <simon@instructure.com> Tested-by: Jenkins Product-Review: Ryan Shaw <ryan@instructure.com> QA-Review: Ryan Shaw <ryan@instructure.com>
1 parent 1307ba8 commit 6421818

7 files changed

Lines changed: 17 additions & 20 deletions

frontend_build/baseWebpackConfig.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ var bundleEntries = require("./bundles");
77
var BundleExtensionsPlugin = require("./BundleExtensionsPlugin");
88
var WebpackOnBuildPlugin = require('on-build-webpack');
99
var path = require('path');
10+
require('babel-polyfill')
1011

1112
module.exports = {
1213
devtool: 'eval',

frontend_build/i18nLinerHandlebars.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
// compilation to extract i18nliner scopes, and then we wrap the resulting
44
// template in an AMD module, giving it dependencies on handlebars, it's scoped
55
// i18n object if it needs one, and any brandableCss variant stuff it needs.
6-
import Handlebars from 'handlebars'
7-
import {pick} from 'lodash'
8-
import {EmberHandlebars} from 'ember-template-compiler'
9-
import ScopedHbsExtractor from './../gems/canvas_i18nliner/js/scoped_hbs_extractor'
10-
import {allFingerprintsFor} from 'brandable_css/lib/main'
11-
import PreProcessor from './../gems/canvas_i18nliner/node_modules/i18nliner-handlebars/dist/lib/pre_processor'
12-
import './../gems/canvas_i18nliner/js/scoped_hbs_pre_processor'
6+
const Handlebars = require('handlebars')
7+
const {pick} = require('lodash')
8+
const {EmberHandlebars} = require('ember-template-compiler')
9+
const ScopedHbsExtractor = require('./../gems/canvas_i18nliner/js/scoped_hbs_extractor')
10+
const {allFingerprintsFor} = require('brandable_css/lib/main')
11+
const PreProcessor = require('./../gems/canvas_i18nliner/node_modules/i18nliner-handlebars/dist/lib/pre_processor')
12+
require('./../gems/canvas_i18nliner/js/scoped_hbs_pre_processor')
1313

1414
const compileHandlebars = (data) => {
1515
const path = data.path
@@ -123,14 +123,14 @@ const buildPartialRequirements = (partialPaths) => {
123123
return requirements
124124
}
125125

126-
export default function i18nLinerHandlebarsLoader (source) {
126+
module.exports = function i18nLinerHandlebarsLoader (source) {
127127
this.cacheable()
128128
const name = resourceName(this.resourcePath)
129129
const dependencies = ['handlebars']
130130

131-
var partialRegistration = emitPartialRegistration(this.resourcePath, name)
131+
const partialRegistration = emitPartialRegistration(this.resourcePath, name)
132132

133-
var cssRegistration = buildCssReference(name)
133+
const cssRegistration = buildCssReference(name)
134134
if (cssRegistration){
135135
// arguments[1] will be brandableCss
136136
dependencies.push('compiled/util/brandableCss')
@@ -149,6 +149,6 @@ export default function i18nLinerHandlebarsLoader (source) {
149149
if (result.translationCount > 0) {
150150
dependencies.push('i18n!' + result.scope)
151151
}
152-
var compiledTemplate = emitTemplate(this.resourcePath, name, result, dependencies, cssRegistration, partialRegistration)
152+
const compiledTemplate = emitTemplate(this.resourcePath, name, result, dependencies, cssRegistration, partialRegistration)
153153
return compiledTemplate
154154
}

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,9 @@
113113
"webpack": "webpack --progress --color --watch",
114114
"webpack-development": "webpack --progress --color",
115115
"webpack-stats": "webpack --profile --json",
116-
"webpack-test": "NODE_ENV=test webpack --progress --color --config webpack.test.config.babel.js",
117-
"webpack-test-ember": "NODE_ENV=test WEBPACK_TEST_BUNDLE=ember webpack --progress --color --config webpack.test.config.babel.js",
118-
"webpack-test-watch": "NODE_ENV=test webpack --progress --color --watch --config webpack.test.config.babel.js",
119-
"webpack-production": "NODE_ENV=production webpack --progress --color --config webpack.production.config.babel.js"
116+
"webpack-test": "NODE_ENV=test webpack --progress --color --config webpack.test.config.js",
117+
"webpack-test-ember": "NODE_ENV=test WEBPACK_TEST_BUNDLE=ember webpack --progress --color --config webpack.test.config.js",
118+
"webpack-test-watch": "NODE_ENV=test webpack --progress --color --watch --config webpack.test.config.js",
119+
"webpack-production": "NODE_ENV=production webpack --progress --color --config webpack.production.config.js"
120120
}
121121
}

webpack.config.babel.js

Lines changed: 0 additions & 3 deletions
This file was deleted.

webpack.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = require('./frontend_build/baseWebpackConfig')
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import 'babel-polyfill'
21
var webpack = require("webpack");
32
var baseWebpackConfig = require("./frontend_build/baseWebpackConfig");
43
var productionWebpackConfig = baseWebpackConfig;
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import 'babel-polyfill'
21
var webpack = require("webpack");
32
var I18nPlugin = require("./frontend_build/i18nPlugin");
43
var ClientAppsPlugin = require("./frontend_build/clientAppPlugin");

0 commit comments

Comments
 (0)