diff --git a/frontend_build/baseWebpackConfig.js b/frontend_build/baseWebpackConfig.js index 6bd7a49a891ac..fda45d570179a 100644 --- a/frontend_build/baseWebpackConfig.js +++ b/frontend_build/baseWebpackConfig.js @@ -7,6 +7,7 @@ var bundleEntries = require("./bundles"); var BundleExtensionsPlugin = require("./BundleExtensionsPlugin"); var WebpackOnBuildPlugin = require('on-build-webpack'); var path = require('path'); +require('babel-polyfill') module.exports = { devtool: 'eval', diff --git a/frontend_build/i18nLinerHandlebars.js b/frontend_build/i18nLinerHandlebars.js index 378cde9203c25..d966a3c97d3b0 100644 --- a/frontend_build/i18nLinerHandlebars.js +++ b/frontend_build/i18nLinerHandlebars.js @@ -3,13 +3,13 @@ // compilation to extract i18nliner scopes, and then we wrap the resulting // template in an AMD module, giving it dependencies on handlebars, it's scoped // i18n object if it needs one, and any brandableCss variant stuff it needs. -import Handlebars from 'handlebars' -import {pick} from 'lodash' -import {EmberHandlebars} from 'ember-template-compiler' -import ScopedHbsExtractor from './../gems/canvas_i18nliner/js/scoped_hbs_extractor' -import {allFingerprintsFor} from 'brandable_css/lib/main' -import PreProcessor from './../gems/canvas_i18nliner/node_modules/i18nliner-handlebars/dist/lib/pre_processor' -import './../gems/canvas_i18nliner/js/scoped_hbs_pre_processor' +const Handlebars = require('handlebars') +const {pick} = require('lodash') +const {EmberHandlebars} = require('ember-template-compiler') +const ScopedHbsExtractor = require('./../gems/canvas_i18nliner/js/scoped_hbs_extractor') +const {allFingerprintsFor} = require('brandable_css/lib/main') +const PreProcessor = require('./../gems/canvas_i18nliner/node_modules/i18nliner-handlebars/dist/lib/pre_processor') +require('./../gems/canvas_i18nliner/js/scoped_hbs_pre_processor') const compileHandlebars = (data) => { const path = data.path @@ -123,14 +123,14 @@ const buildPartialRequirements = (partialPaths) => { return requirements } -export default function i18nLinerHandlebarsLoader (source) { +module.exports = function i18nLinerHandlebarsLoader (source) { this.cacheable() const name = resourceName(this.resourcePath) const dependencies = ['handlebars'] - var partialRegistration = emitPartialRegistration(this.resourcePath, name) + const partialRegistration = emitPartialRegistration(this.resourcePath, name) - var cssRegistration = buildCssReference(name) + const cssRegistration = buildCssReference(name) if (cssRegistration){ // arguments[1] will be brandableCss dependencies.push('compiled/util/brandableCss') @@ -149,6 +149,6 @@ export default function i18nLinerHandlebarsLoader (source) { if (result.translationCount > 0) { dependencies.push('i18n!' + result.scope) } - var compiledTemplate = emitTemplate(this.resourcePath, name, result, dependencies, cssRegistration, partialRegistration) + const compiledTemplate = emitTemplate(this.resourcePath, name, result, dependencies, cssRegistration, partialRegistration) return compiledTemplate } diff --git a/package.json b/package.json index f6b8a213e7a5f..e3b81c2895b56 100644 --- a/package.json +++ b/package.json @@ -113,9 +113,9 @@ "webpack": "webpack --progress --color --watch", "webpack-development": "webpack --progress --color", "webpack-stats": "webpack --profile --json", - "webpack-test": "NODE_ENV=test webpack --progress --color --config webpack.test.config.babel.js", - "webpack-test-ember": "NODE_ENV=test WEBPACK_TEST_BUNDLE=ember webpack --progress --color --config webpack.test.config.babel.js", - "webpack-test-watch": "NODE_ENV=test webpack --progress --color --watch --config webpack.test.config.babel.js", - "webpack-production": "NODE_ENV=production webpack --progress --color --config webpack.production.config.babel.js" + "webpack-test": "NODE_ENV=test webpack --progress --color --config webpack.test.config.js", + "webpack-test-ember": "NODE_ENV=test WEBPACK_TEST_BUNDLE=ember webpack --progress --color --config webpack.test.config.js", + "webpack-test-watch": "NODE_ENV=test webpack --progress --color --watch --config webpack.test.config.js", + "webpack-production": "NODE_ENV=production webpack --progress --color --config webpack.production.config.js" } } diff --git a/webpack.config.babel.js b/webpack.config.babel.js deleted file mode 100644 index 1ab592aa3f132..0000000000000 --- a/webpack.config.babel.js +++ /dev/null @@ -1,3 +0,0 @@ -import 'babel-polyfill' -import webpackConfig from './frontend_build/baseWebpackConfig' -export default webpackConfig diff --git a/webpack.config.js b/webpack.config.js new file mode 100644 index 0000000000000..d9c95cb869e2a --- /dev/null +++ b/webpack.config.js @@ -0,0 +1 @@ +module.exports = require('./frontend_build/baseWebpackConfig') diff --git a/webpack.production.config.babel.js b/webpack.production.config.js similarity index 98% rename from webpack.production.config.babel.js rename to webpack.production.config.js index 48fe1f36644d5..22e5a0f3097e1 100644 --- a/webpack.production.config.babel.js +++ b/webpack.production.config.js @@ -1,4 +1,3 @@ -import 'babel-polyfill' var webpack = require("webpack"); var baseWebpackConfig = require("./frontend_build/baseWebpackConfig"); var productionWebpackConfig = baseWebpackConfig; diff --git a/webpack.test.config.babel.js b/webpack.test.config.js similarity index 99% rename from webpack.test.config.babel.js rename to webpack.test.config.js index f5dabb29ffe5d..2aa5e5765793d 100644 --- a/webpack.test.config.babel.js +++ b/webpack.test.config.js @@ -1,4 +1,3 @@ -import 'babel-polyfill' var webpack = require("webpack"); var I18nPlugin = require("./frontend_build/i18nPlugin"); var ClientAppsPlugin = require("./frontend_build/clientAppPlugin");