diff --git a/src/index.js b/src/index.js index 69787f4b..7bf406ab 100644 --- a/src/index.js +++ b/src/index.js @@ -17,7 +17,7 @@ import { isFunction, } from './lib/helpers'; -const NS = fs.realpathSync(__dirname); +const NS = path.dirname(fs.realpathSync(__filename)); let nextId = 0; diff --git a/src/loader.js b/src/loader.js index 83ae03a8..f552c6eb 100644 --- a/src/loader.js +++ b/src/loader.js @@ -1,4 +1,5 @@ import fs from 'fs'; +import path from 'path'; import loaderUtils from 'loader-utils'; import NodeTemplatePlugin from 'webpack/lib/node/NodeTemplatePlugin'; import NodeTargetPlugin from 'webpack/lib/node/NodeTargetPlugin'; @@ -6,7 +7,7 @@ import LibraryTemplatePlugin from 'webpack/lib/LibraryTemplatePlugin'; import SingleEntryPlugin from 'webpack/lib/SingleEntryPlugin'; import LimitChunkCountPlugin from 'webpack/lib/optimize/LimitChunkCountPlugin'; -const NS = fs.realpathSync(__dirname); +const NS = path.dirname(fs.realpathSync(__filename)); export default source => source;