Skip to content
This repository has been archived by the owner on Jan 25, 2024. It is now read-only.

Commit

Permalink
Merge pull request #32 from kwonoj/feat-sourcemap
Browse files Browse the repository at this point in the history
build(webpack): generate source map
  • Loading branch information
kwonoj authored Jul 14, 2018
2 parents e0df230 + df0f79e commit 2668f11
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 9 deletions.
3 changes: 1 addition & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@
"get-stdin": "^6.0.0",
"source-map-support": "^0.5.6",
"tslib": "^1.9.3",
"unixify": "^1.0.0"
"unixify": "^1.0.0",
"v8-compile-cache": "^2.0.0"
},
"devDependencies": {
"@commitlint/cli": "^7.0.0",
Expand Down
7 changes: 3 additions & 4 deletions src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { OutputStyle } from './index';
import { buildContext } from './interop/context';
import { SassOptionsInterface } from './interop/options/sassOptions';
import { SassContextInterface } from './interop/sassContext';
import './verbose';

const d = debug('libsass:cli');
const styleOptions = ['nested', 'expanded', 'compact', 'compressed'];
Expand Down Expand Up @@ -41,8 +40,8 @@ const optionDefinitions = [
defaultOption: true
},
{
name: 'mount',
description: 'Additional path to be mounted other than direct dir to input path',
name: 'root',
description: 'Top level path where sass inputs are located if there are import paths exist other than input path.',
type: String,
multiple: true
}
Expand Down Expand Up @@ -287,7 +286,7 @@ const main = async (argv: Array<string> = process.argv) => {
}

//Mount specified paths
const additionalMountPath = (Array.isArray(options.mount) ? options.mount : []).map(x => interop.mount(x));
const additionalMountPath = (Array.isArray(options.root) ? options.root : []).map(x => interop.mount(x));
const [mountedInput, mountedOutput] = files
.filter(x => !!x)
.map(p => ({ raw: p, dir: path.dirname(p!), file: path.basename(p!) }))
Expand Down
9 changes: 8 additions & 1 deletion src/verbose.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
/** side effect module to enable few verbose logging */
/**
* side effect module to enable few verbose logging.
* This is actual entry point to cli, loads necessary modules up front.
*/
/* tslint:disable:no-var-requires no-require-imports */
require('v8-compile-cache');

if (!!process.env.DEBUG) {
require('source-map-support').install();
const { log, enableLogger } = require('./util/logger');
enableLogger(require('debug')('libsass:logger'));
log('Enabling verbose log');
}

require('./cli');
3 changes: 2 additions & 1 deletion webpack.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import * as webpack from 'webpack';

module.exports = {
mode: 'production',
entry: './src/cli.ts',
entry: './src/verbose.ts',
devtool: 'source-map',

output: {
path: path.resolve(__dirname, 'dist'),
Expand Down

0 comments on commit 2668f11

Please # to comment.