Skip to content
This repository was archived by the owner on May 1, 2020. It is now read-only.

Commit

Permalink
fix(source-maps): source map must correspond to .js file name with a …
Browse files Browse the repository at this point in the history
….map at the end
  • Loading branch information
danbucholtz committed Feb 17, 2017
1 parent 7222880 commit debd88b
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 18 deletions.
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,7 @@ npm run build --rollup ./config/rollup.config.js
| app ng module class | `ionic_app_ng_module_class` | `--appNgModuleClass` | `AppModule` | Exported class name for app's primary `NgModule` |
| clean before copy | `ionic_clean_before_copy` | `--cleanBeforeCopy` | `false` | clean out existing files before copy task runs |
| output js file | `ionic_output_js_file_name` | `--outputJsFileName` | `main.js` | name of js file generated in `buildDir` |
| output js map file | `ionic_output_js_map_file_name` | `--outputJsMapFileName` | `main.js.map` | name of js source map file generated in `buildDir` |
| output css file | `ionic_output_css_file_name` | `--outputCssFileName` | `main.css` | name of css file generated in `buildDir` |
| output css map file | `ionic_output_css_map_file_name` | `--outputCssMapFileName` | `main.css.map` | name of css source map file generated in `buildDir` |
| bail on lint error | `ionic_bail_on_lint_error` | `--bailOnLintError` | `null` | Set to `true` to make stand-alone lint commands fail with non-zero status code |
| write AoT files to disk | `ionic_aot_write_to_disk` | `--aotWriteToDisk` | `null` | Set to `true` to write files to disk for debugging |
| print dependency tree | `ionic_print_original_dependency_tree` | `--printOriginalDependencyTree` | `null` | Set to `true` to print out the original dependency tree calculated during the optimize step |
Expand Down Expand Up @@ -169,9 +167,7 @@ These environment variables are automatically set to [Node's `process.env`](http
| `IONIC_CLEAN_BEFORE_COPY` | Attempt to clean existing directories before copying files. |
| `IONIC_CLOSURE_JAR` | The absolute path ot the closure compiler jar file |
| `IONIC_OUTPUT_JS_FILE_NAME` | The file name of the generated javascript file |
| `IONIC_OUTPUT_JS_MAP_FILE_NAME` | The file name of the generated javascript source map file |
| `IONIC_OUTPUT_CSS_FILE_NAME` | The file name of the generated css file |
| `IONIC_OUTPUT_CSS_MAP_FILE_NAME` | The file name of the generated css source map file |
| `IONIC_WEBPACK_FACTORY` | The absolute path to Ionic's `webpack-factory` script |
| `IONIC_WEBPACK_LOADER` | The absolute path to Ionic's custom webpack loader |
| `IONIC_BAIL_ON_LINT_ERROR` | Boolean determining whether to exit with a non-zero status code on error |
Expand Down
4 changes: 2 additions & 2 deletions config/uglifyjs.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ module.exports = {
/**
* inSourceMap: file name for the input source map
*/
inSourceMap: process.env.IONIC_OUTPUT_JS_MAP_FILE_NAME,
inSourceMap: process.env.IONIC_OUTPUT_JS_FILE_NAME + '.map',

/**
* outSourceMap: file name for the output source map
*/
outSourceMap: process.env.IONIC_OUTPUT_JS_MAP_FILE_NAME,
outSourceMap: process.env.IONIC_OUTPUT_JS_FILE_NAME + '.map',

/**
* mangle: uglify 2's mangle option
Expand Down
2 changes: 0 additions & 2 deletions src/util/config.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,7 @@ describe('config', () => {
expect(fakeConfig[Constants.ENV_CLEAN_BEFORE_COPY]).toBeFalsy();
expect(fakeConfig[Constants.ENV_CLOSURE_JAR]).toEqual(join(fakeConfig[Constants.ENV_VAR_APP_SCRIPTS_DIR], 'bin', 'closure-compiler.jar'));
expect(fakeConfig[Constants.ENV_OUTPUT_JS_FILE_NAME]).toEqual('main.js');
expect(fakeConfig[Constants.ENV_OUTPUT_JS_MAP_FILE_NAME]).toEqual('main.js.map');
expect(fakeConfig[Constants.ENV_OUTPUT_CSS_FILE_NAME]).toEqual('main.css');
expect(fakeConfig[Constants.ENV_OUTPUT_CSS_MAP_FILE_NAME]).toEqual('main.css.map');
expect(fakeConfig[Constants.ENV_WEBPACK_FACTORY]).toEqual(join(fakeConfig[Constants.ENV_VAR_APP_SCRIPTS_DIR], 'dist', 'webpack', 'ionic-webpack-factory.js'));
expect(fakeConfig[Constants.ENV_WEBPACK_LOADER]).toEqual(join(fakeConfig[Constants.ENV_VAR_APP_SCRIPTS_DIR], 'dist', 'webpack', 'loader.js'));
expect(fakeConfig[Constants.ENV_OPTIMIZATION_LOADER]).toEqual(join(fakeConfig[Constants.ENV_VAR_APP_SCRIPTS_DIR], 'dist', 'webpack', 'optimization-loader.js'));
Expand Down
8 changes: 0 additions & 8 deletions src/util/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,18 +151,10 @@ export function generateContext(context?: BuildContext): BuildContext {
setProcessEnvVar(Constants.ENV_OUTPUT_JS_FILE_NAME, outputJsFileName);
Logger.debug(`outputJsFileName set to ${outputJsFileName}`);

const outputJsMapFileName = getConfigValue(context, '--outputJsMapFileName', null, Constants.ENV_OUTPUT_JS_MAP_FILE_NAME, Constants.ENV_OUTPUT_JS_MAP_FILE_NAME.toLowerCase(), 'main.js.map');
setProcessEnvVar(Constants.ENV_OUTPUT_JS_MAP_FILE_NAME, outputJsMapFileName);
Logger.debug(`outputJsMapFileName set to ${outputJsMapFileName}`);

const outputCssFileName = getConfigValue(context, '--outputCssFileName', null, Constants.ENV_OUTPUT_CSS_FILE_NAME, Constants.ENV_OUTPUT_CSS_FILE_NAME.toLowerCase(), 'main.css');
setProcessEnvVar(Constants.ENV_OUTPUT_CSS_FILE_NAME, outputCssFileName);
Logger.debug(`outputCssFileName set to ${outputCssFileName}`);

const outputCssMapFileName = getConfigValue(context, '--outputCssMapFileName', null, Constants.ENV_OUTPUT_CSS_MAP_FILE_NAME, Constants.ENV_OUTPUT_CSS_MAP_FILE_NAME.toLowerCase(), 'main.css.map');
setProcessEnvVar(Constants.ENV_OUTPUT_CSS_MAP_FILE_NAME, outputCssMapFileName);
Logger.debug(`outputCssMapFileName set to ${outputCssMapFileName}`);

const webpackFactoryPath = join(getProcessEnvVar(Constants.ENV_VAR_APP_SCRIPTS_DIR), 'dist', 'webpack', 'ionic-webpack-factory.js');
setProcessEnvVar(Constants.ENV_WEBPACK_FACTORY, webpackFactoryPath);
Logger.debug(`webpackFactoryPath set to ${webpackFactoryPath}`);
Expand Down
2 changes: 0 additions & 2 deletions src/util/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,7 @@ export const ENV_CLOSURE_JAR = 'IONIC_CLOSURE_JAR';
export const ENV_READ_CONFIG_JSON = 'IONIC_READ_CONFIG_JSON';

export const ENV_OUTPUT_JS_FILE_NAME = 'IONIC_OUTPUT_JS_FILE_NAME';
export const ENV_OUTPUT_JS_MAP_FILE_NAME = 'IONIC_OUTPUT_JS_MAP_FILE_NAME';
export const ENV_OUTPUT_CSS_FILE_NAME = 'IONIC_OUTPUT_CSS_FILE_NAME';
export const ENV_OUTPUT_CSS_MAP_FILE_NAME = 'IONIC_OUTPUT_CSS_MAP_FILE_NAME';
export const ENV_WEBPACK_FACTORY = 'IONIC_WEBPACK_FACTORY';
export const ENV_WEBPACK_LOADER = 'IONIC_WEBPACK_LOADER';
export const ENV_OPTIMIZATION_LOADER = 'IONIC_OPTIMIZATION_LOADER';
Expand Down

0 comments on commit debd88b

Please sign in to comment.