0
私はnpm run build
をbashから実行し、ターゲットフォルダ(lib
)にはファイルがありません。ここでWebpack - アプリケーションをビルドした後の空のターゲットフォルダ
は私のwebpack.config-build.jsファイルです。ここで
var path = require('path');
var webpack = require("webpack");
const TARGET = process.env.npm_lifecycle_event;
module.exports = {
entry: [path.join(__dirname, '/src/index.js')],
module: {
rules: [{
test: /\.js?$/,
use: ['babel-loader'],
include: path.join(__dirname, '/src')
}]
},
output: {
filename: 'index.js',
path: path.resolve(__dirname, '/lib')
},
plugins: [
new webpack.IgnorePlugin(/react\/addons/),
new webpack.IgnorePlugin(/react\/lib\/ReactContext/),
new webpack.IgnorePlugin(/react\/lib\/ExecutionEnvironment/)
],
target: 'node'
};
は、出力はコマンド(エラーなし)を実行した後、次のとおりです。
Hash: 9e969aec2448315372a9
Version: webpack 2.2.1
Time: 3121ms
Asset Size Chunks Chunk Names
index.js 2.67 MB 0 [emitted] [big] main
[15] ./~/react/react.js 56 bytes {0} [built]
[121] ./~/enzyme/build/ReactWrapper.js 40 kB {0} [built]
[123] ./~/enzyme/build/ShallowWrapper.js 42.7 kB {0} [built]
[140] ./~/intl-messageformat/index.js 553 bytes {0} [built]
[213] ./src/index.js 2.43 kB {0} [built]
[238] ./~/enzyme/build/index.js 973 bytes {0} [built]
[239] ./~/enzyme/build/mount.js 549 bytes {0} [built]
[240] ./~/enzyme/build/render.js 1.04 kB {0} [built]
[241] ./~/enzyme/build/shallow.js 544 bytes {0} [built]
[264] ./~/graceful-fs/graceful-fs.js 6.94 kB {0} [optional] [built]
[272] ./~/intl-format-cache/index.js 110 bytes {0} [built]
[293] ./~/jsonfile/index.js 3.13 kB {0} [built]
[470] ./~/react-intl/lib/index.es.js 55 kB {0} [built]
[471] ./~/react-intl/locale-data/index.js 290 kB {0} [built]
[494] multi ./src/index.js 28 bytes {0} [built]
+ 480 hidden modules